MODULE OUTPUT_DATA

! Output quantity arrays

USE PRECISION_PARAMETERS
USE GLOBAL_CONSTANTS, ONLY: CELL_CENTER
IMPLICIT NONE

INTEGER, PARAMETER :: N_Q_DOT=8,N_M_DOT=4
INTEGER :: PLOT3D_QUANTITY_INDEX(5),PLOT3D_Y_INDEX(5)=0,PLOT3D_Z_INDEX(5)=0,PLOT3D_PART_INDEX(5),&
           SMOKE3D_QUANTITY_INDEX(4),SMOKE3D_Y_INDEX(4)=0,SMOKE3D_Z_INDEX(4)=0,PLOT3D_VELO_INDEX(5)=0
CHARACTER(LABEL_LENGTH) :: PLOT3D_QUANTITY(5),PLOT3D_SPEC_ID(5),PLOT3D_PART_ID(5),PLOT3D_SMOKEVIEW_BAR_LABEL(5),&
                 SMOKE3D_QUANTITY(4),SMOKE3D_SPEC_ID(4),SMOKE3D_SMOKEVIEW_BAR_LABEL(4)
CHARACTER(LABEL_LENGTH) :: PLOT3D_SMOKEVIEW_LABEL(5),SMOKE3D_SMOKEVIEW_LABEL(4)
INTEGER :: N_BNDF,N_ISOF,N_PROF,N_SLCF_MAX=0
REAL(EB) :: T_LAST_DUMP_HRR,T_LAST_DUMP_MASS,T_LAST_DUMP_MOM
REAL(EB),ALLOCATABLE, DIMENSION(:) :: ENTHALPY_SUM
REAL(EB),ALLOCATABLE, DIMENSION(:,:) :: MINT,MINT_SUM,Q_DOT,Q_DOT_SUM,M_DOT,M_DOT_SUM

TYPE OUTPUT_QUANTITY_TYPE
   CHARACTER(LABEL_LENGTH) :: NAME='null',OLD_NAME='null',SHORT_NAME='null',UNITS='null'
   REAL(EB) :: AMBIENT_VALUE=0._EB
   INTEGER :: IOR=0,CELL_POSITION=CELL_CENTER
   LOGICAL :: SLCF_APPROPRIATE=.TRUE.,BNDF_APPROPRIATE=.FALSE.,ISOF_APPROPRIATE=.TRUE.,PART_APPROPRIATE=.FALSE.,&
              INTEGRATED=.FALSE.,SOLID_PHASE=.FALSE.,GAS_PHASE=.TRUE.,INTEGRATED_PARTICLES=.FALSE.,&
              MASS_FRACTION=.FALSE.,SPEC_ID_REQUIRED=.FALSE.,PART_ID_REQUIRED=.FALSE.,INSIDE_SOLID=.FALSE.,&
              MATL_ID_REQUIRED=.FALSE.,TIME_AVERAGED=.TRUE.,DEVC_APPROPRIATE=.TRUE.,&
              DUCT_ID_REQUIRED=.FALSE.,NODE_ID_REQUIRED=.FALSE.,HVAC=.FALSE.,QUANTITY2_REQUIRED=.FALSE.,&
              CELL_L_REQUIRED=.FALSE.
END TYPE OUTPUT_QUANTITY_TYPE

TYPE (OUTPUT_QUANTITY_TYPE), DIMENSION(:), ALLOCATABLE, TARGET :: OUTPUT_QUANTITY

CONTAINS


SUBROUTINE DEFINE_OUTPUT_QUANTITIES

! Define all OUTPUT_QUANTITYs and their attributes

USE GLOBAL_CONSTANTS, ONLY: CELL_FACE,CELL_EDGE
USE MEMORY_FUNCTIONS, ONLY:ChkMemErr

INTEGER :: N,IZERO

ALLOCATE(OUTPUT_QUANTITY(-N_OUTPUT_QUANTITIES:N_OUTPUT_QUANTITIES),STAT=IZERO)
CALL ChkMemErr('READ','OUTPUT_QUANTITY',IZERO)

DO N=-N_OUTPUT_QUANTITIES,N_OUTPUT_QUANTITIES
   IF (N < 0) THEN
      OUTPUT_QUANTITY(N)%SOLID_PHASE = .TRUE.
      OUTPUT_QUANTITY(N)%ISOF_APPROPRIATE = .FALSE.
      OUTPUT_QUANTITY(N)%SLCF_APPROPRIATE = .FALSE.
      OUTPUT_QUANTITY(N)%BNDF_APPROPRIATE = .TRUE.
      OUTPUT_QUANTITY(N)%PART_APPROPRIATE = .TRUE.
   ENDIF
ENDDO

OUTPUT_QUANTITY(0)%NAME        = 'SMOKE/WATER'
OUTPUT_QUANTITY(0)%UNITS       = '  '
OUTPUT_QUANTITY(0)%SHORT_NAME  = '  '

OUTPUT_QUANTITY(1)%NAME  = 'DENSITY'
OUTPUT_QUANTITY(1)%UNITS  = 'kg/m3'
OUTPUT_QUANTITY(1)%SHORT_NAME  = 'rho'

OUTPUT_QUANTITY(2)%NAME  = 'F_X'
OUTPUT_QUANTITY(2)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(2)%SHORT_NAME  = 'f_x'
OUTPUT_QUANTITY(2)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(2)%IOR = 1

OUTPUT_QUANTITY(3)%NAME  = 'F_Y'
OUTPUT_QUANTITY(3)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(3)%SHORT_NAME  = 'f_y'
OUTPUT_QUANTITY(3)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(3)%IOR = 2

OUTPUT_QUANTITY(4)%NAME  = 'F_Z'
OUTPUT_QUANTITY(4)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(4)%SHORT_NAME  = 'f_z'
OUTPUT_QUANTITY(4)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(4)%IOR = 3

OUTPUT_QUANTITY(5)%NAME  = 'TEMPERATURE'
OUTPUT_QUANTITY(5)%UNITS  = 'C'
OUTPUT_QUANTITY(5)%SHORT_NAME  = 'temp'

OUTPUT_QUANTITY(6)%NAME  = 'U-VELOCITY'
OUTPUT_QUANTITY(6)%UNITS  = 'm/s'
OUTPUT_QUANTITY(6)%SHORT_NAME  = 'U-VEL'
OUTPUT_QUANTITY(6)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(6)%IOR = 1

OUTPUT_QUANTITY(7)%NAME  = 'V-VELOCITY'
OUTPUT_QUANTITY(7)%UNITS = 'm/s'
OUTPUT_QUANTITY(7)%SHORT_NAME  = 'V-VEL'
OUTPUT_QUANTITY(7)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(7)%IOR = 2

OUTPUT_QUANTITY(8)%NAME  = 'W-VELOCITY'
OUTPUT_QUANTITY(8)%UNITS  = 'm/s'
OUTPUT_QUANTITY(8)%SHORT_NAME  = 'W-VEL'
OUTPUT_QUANTITY(8)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(8)%IOR = 3

OUTPUT_QUANTITY(6:8)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(9)%NAME  = 'PRESSURE'
OUTPUT_QUANTITY(9)%UNITS  = 'Pa'
OUTPUT_QUANTITY(9)%SHORT_NAME  = 'pres'

OUTPUT_QUANTITY(10)%NAME = 'VELOCITY'
OUTPUT_QUANTITY(10)%UNITS = 'm/s'
OUTPUT_QUANTITY(10)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(11)%NAME = 'HRRPUV'
OUTPUT_QUANTITY(11)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(11)%SHORT_NAME = 'hrrpuv'

OUTPUT_QUANTITY(12)%NAME = 'H'
OUTPUT_QUANTITY(12)%UNITS = '(m/s)^2'
OUTPUT_QUANTITY(12)%SHORT_NAME = 'head'

OUTPUT_QUANTITY(13)%NAME = 'MIXTURE FRACTION'
OUTPUT_QUANTITY(13)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(13)%SHORT_NAME = 'Z'

OUTPUT_QUANTITY(14)%NAME = 'DIVERGENCE'
OUTPUT_QUANTITY(14)%UNITS = '1/s'
OUTPUT_QUANTITY(14)%SHORT_NAME = 'div'

OUTPUT_QUANTITY(15)%NAME = 'MIXING TIME'
OUTPUT_QUANTITY(15)%UNITS = 's'
OUTPUT_QUANTITY(15)%SHORT_NAME = 'mix'

OUTPUT_QUANTITY(16)%NAME = 'ABSORPTION COEFFICIENT'
OUTPUT_QUANTITY(16)%UNITS = '1/m'
OUTPUT_QUANTITY(16)%SHORT_NAME = 'kappa'

OUTPUT_QUANTITY(17)%NAME = 'VISCOSITY'
OUTPUT_QUANTITY(17)%UNITS = 'kg/m/s'
OUTPUT_QUANTITY(17)%SHORT_NAME = 'mu eff'

OUTPUT_QUANTITY(18)%NAME = 'INTEGRATED INTENSITY'
OUTPUT_QUANTITY(18)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(18)%SHORT_NAME = 'U'

OUTPUT_QUANTITY(19)%NAME = 'RADIATION LOSS'
OUTPUT_QUANTITY(19)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(19)%SHORT_NAME = 'loss'

OUTPUT_QUANTITY(20)%NAME = 'PARTICLE RADIATION LOSS'
OUTPUT_QUANTITY(20)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(20)%SHORT_NAME = 'part_rad'

OUTPUT_QUANTITY(21)%NAME = 'RELATIVE HUMIDITY'
OUTPUT_QUANTITY(21)%UNITS = '%'
OUTPUT_QUANTITY(21)%SHORT_NAME = 'humid'

OUTPUT_QUANTITY(22)%NAME = 'HS'
OUTPUT_QUANTITY(22)%UNITS = 'm2/s2'
OUTPUT_QUANTITY(22)%SHORT_NAME = 'hs'

OUTPUT_QUANTITY(23)%NAME = 'KINETIC ENERGY'
OUTPUT_QUANTITY(23)%UNITS = 'm2/s2'
OUTPUT_QUANTITY(23)%SHORT_NAME = 'ke'

! Strain and Vorticity

OUTPUT_QUANTITY(24)%NAME = 'STRAIN RATE X'
OUTPUT_QUANTITY(24)%UNITS = '1/s'
OUTPUT_QUANTITY(24)%SHORT_NAME = 'strain_x'
OUTPUT_QUANTITY(24)%IOR = 1

OUTPUT_QUANTITY(25)%NAME = 'STRAIN RATE Y'
OUTPUT_QUANTITY(25)%UNITS = '1/s'
OUTPUT_QUANTITY(25)%SHORT_NAME = 'strain_y'
OUTPUT_QUANTITY(25)%IOR = 2

OUTPUT_QUANTITY(26)%NAME = 'STRAIN RATE Z'
OUTPUT_QUANTITY(26)%UNITS = '1/s'
OUTPUT_QUANTITY(26)%SHORT_NAME = 'strain_z'
OUTPUT_QUANTITY(26)%IOR = 3

OUTPUT_QUANTITY(27)%NAME = 'VORTICITY X'
OUTPUT_QUANTITY(27)%UNITS = '1/s'
OUTPUT_QUANTITY(27)%SHORT_NAME = 'vort_x'
OUTPUT_QUANTITY(27)%IOR = 1

OUTPUT_QUANTITY(28)%NAME = 'VORTICITY Y'
OUTPUT_QUANTITY(28)%UNITS = '1/s'
OUTPUT_QUANTITY(28)%SHORT_NAME = 'vort_y'
OUTPUT_QUANTITY(28)%IOR = 2

OUTPUT_QUANTITY(29)%NAME = 'VORTICITY Z'
OUTPUT_QUANTITY(29)%UNITS = '1/s'
OUTPUT_QUANTITY(29)%SHORT_NAME = 'vort_z'
OUTPUT_QUANTITY(29)%IOR = 3

OUTPUT_QUANTITY(24:29)%CELL_POSITION = CELL_EDGE

OUTPUT_QUANTITY(30)%NAME = 'C_SMAG'
OUTPUT_QUANTITY(30)%UNITS = '  '
OUTPUT_QUANTITY(30)%SHORT_NAME = 'c_smag'

OUTPUT_QUANTITY(31)%NAME = 'SPECIFIC HEAT'
OUTPUT_QUANTITY(31)%UNITS = 'kJ/kg/K'
OUTPUT_QUANTITY(31)%SHORT_NAME = 'c_p'

OUTPUT_QUANTITY(32)%NAME = 'HRRPUA'
OUTPUT_QUANTITY(32)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(32)%SHORT_NAME = 'hrrpua'

OUTPUT_QUANTITY(33)%NAME = 'CONDUCTIVITY'
OUTPUT_QUANTITY(33)%UNITS = 'W/m/K'
OUTPUT_QUANTITY(33)%SHORT_NAME = 'k'

OUTPUT_QUANTITY(34)%NAME = 'BACKGROUND PRESSURE'
OUTPUT_QUANTITY(34)%UNITS = 'Pa'
OUTPUT_QUANTITY(34)%SHORT_NAME = 'pbar'

OUTPUT_QUANTITY(35)%NAME = 'MOLECULAR WEIGHT'
OUTPUT_QUANTITY(35)%UNITS = 'g/mol'
OUTPUT_QUANTITY(35)%SHORT_NAME = 'MW'

OUTPUT_QUANTITY(36)%NAME = 'POTENTIAL TEMPERATURE'
OUTPUT_QUANTITY(36)%UNITS = 'K'
OUTPUT_QUANTITY(36)%SHORT_NAME = 'theta'

OUTPUT_QUANTITY(37)%NAME = 'DIFFUSIVITY'
OUTPUT_QUANTITY(37)%UNITS = 'm^2/s'
OUTPUT_QUANTITY(37)%SHORT_NAME = 'D'

! Time and benchmarking stats

OUTPUT_QUANTITY(38)%NAME = 'RTE SOURCE CORRECTION FACTOR'
OUTPUT_QUANTITY(38)%UNITS = ' '
OUTPUT_QUANTITY(38)%SHORT_NAME = 'C'

OUTPUT_QUANTITY(39)%NAME = 'RAM'  ! This is a non-standard output. To make it work, you must uncomment GETPID in func.f90.
OUTPUT_QUANTITY(39)%UNITS = 'MB'
OUTPUT_QUANTITY(39)%SHORT_NAME = 'RAM'

OUTPUT_QUANTITY(40)%NAME = 'TIME'
OUTPUT_QUANTITY(40)%UNITS = 's'
OUTPUT_QUANTITY(40)%SHORT_NAME = 't'

OUTPUT_QUANTITY(41)%NAME = 'TIME STEP'
OUTPUT_QUANTITY(41)%UNITS = 's'
OUTPUT_QUANTITY(41)%SHORT_NAME = 'dt'

OUTPUT_QUANTITY(42)%NAME = 'WALL CLOCK TIME'
OUTPUT_QUANTITY(42)%UNITS = 's'
OUTPUT_QUANTITY(42)%SHORT_NAME = 't_wall'

OUTPUT_QUANTITY(43)%NAME = 'WALL CLOCK TIME ITERATIONS'
OUTPUT_QUANTITY(43)%UNITS = 's'
OUTPUT_QUANTITY(43)%SHORT_NAME = 't_wall_it'

OUTPUT_QUANTITY(44)%NAME = 'CPU TIME'
OUTPUT_QUANTITY(44)%UNITS = 's'
OUTPUT_QUANTITY(44)%SHORT_NAME = 't_cpu'

OUTPUT_QUANTITY(45)%NAME = 'ITERATION'
OUTPUT_QUANTITY(45)%UNITS = ' '
OUTPUT_QUANTITY(45)%SHORT_NAME = 'step'

OUTPUT_QUANTITY(38:45)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(38:45)%ISOF_APPROPRIATE = .FALSE.

! Enthalpy

OUTPUT_QUANTITY(46)%NAME = 'SPECIFIC ENTHALPY'
OUTPUT_QUANTITY(46)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(46)%SHORT_NAME = 'h'

OUTPUT_QUANTITY(47)%NAME = 'ENTHALPY'
OUTPUT_QUANTITY(47)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(47)%SHORT_NAME = 'H'

OUTPUT_QUANTITY(48)%NAME = 'SPECIFIC SENSIBLE ENTHALPY'
OUTPUT_QUANTITY(48)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(48)%SHORT_NAME = 'h_s'

OUTPUT_QUANTITY(49)%NAME = 'SENSIBLE ENTHALPY'
OUTPUT_QUANTITY(49)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(49)%SHORT_NAME = 'H_s'

! Measures of turbulence resolution (diagnostics)

OUTPUT_QUANTITY(52)%NAME = 'WAVELET ERROR'
OUTPUT_QUANTITY(52)%UNITS = '  '
OUTPUT_QUANTITY(52)%SHORT_NAME = 'wem'
OUTPUT_QUANTITY(52)%QUANTITY2_REQUIRED = .TRUE.
OUTPUT_QUANTITY(52)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(52)%ISOF_APPROPRIATE = .FALSE.

! Cell-centered velocity components

OUTPUT_QUANTITY(53)%NAME  = 'CELL U'
OUTPUT_QUANTITY(53)%UNITS  = 'm/s'
OUTPUT_QUANTITY(53)%SHORT_NAME  = 'u_p'

OUTPUT_QUANTITY(54)%NAME  = 'CELL V'
OUTPUT_QUANTITY(54)%UNITS  = 'm/s'
OUTPUT_QUANTITY(54)%SHORT_NAME  = 'v_p'

OUTPUT_QUANTITY(55)%NAME  = 'CELL W'
OUTPUT_QUANTITY(55)%UNITS  = 'm/s'
OUTPUT_QUANTITY(55)%SHORT_NAME  = 'w_p'

OUTPUT_QUANTITY(56)%NAME  = 'SUBGRID KINETIC ENERGY'
OUTPUT_QUANTITY(56)%UNITS  = 'm2/s2'
OUTPUT_QUANTITY(56)%SHORT_NAME  = 'k_sgs'

! Pressure iteration info

OUTPUT_QUANTITY(57)%NAME = 'MAXIMUM VELOCITY ERROR'
OUTPUT_QUANTITY(57)%UNITS = 'm/s'
OUTPUT_QUANTITY(57)%SHORT_NAME = 'vel err'
OUTPUT_QUANTITY(57)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(57)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(58)%NAME = 'PRESSURE ITERATIONS'
OUTPUT_QUANTITY(58)%UNITS = ' '
OUTPUT_QUANTITY(58)%SHORT_NAME = 'its'
OUTPUT_QUANTITY(58)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(58)%ISOF_APPROPRIATE = .FALSE.

! Miscellaneous outputs

OUTPUT_QUANTITY(59)%NAME = 'OPEN NOZZLES'
OUTPUT_QUANTITY(59)%UNITS = ' '
OUTPUT_QUANTITY(59)%SHORT_NAME = 'open'
OUTPUT_QUANTITY(59)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(60)%NAME = 'ACTUATED SPRINKLERS'
OUTPUT_QUANTITY(60)%UNITS = ' '
OUTPUT_QUANTITY(60)%SHORT_NAME = 'act'
OUTPUT_QUANTITY(60)%TIME_AVERAGED = .FALSE.

! MEAN_FORCING output

OUTPUT_QUANTITY(61)%NAME = 'U MEAN FORCING'
OUTPUT_QUANTITY(61)%UNITS = 'm/s'
OUTPUT_QUANTITY(61)%SHORT_NAME = 'u_mean'

OUTPUT_QUANTITY(62)%NAME = 'V MEAN FORCING'
OUTPUT_QUANTITY(62)%UNITS = 'm/s'
OUTPUT_QUANTITY(62)%SHORT_NAME = 'v_mean'

OUTPUT_QUANTITY(63)%NAME = 'W MEAN FORCING'
OUTPUT_QUANTITY(63)%UNITS = 'm/s'
OUTPUT_QUANTITY(63)%SHORT_NAME = 'w_mean'

OUTPUT_QUANTITY(61:63)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(61:63)%ISOF_APPROPRIATE = .FALSE.

! ScaRC outputs

OUTPUT_QUANTITY(65)%NAME = 'SCARC RESIDUAL'
OUTPUT_QUANTITY(65)%UNITS = ' '
OUTPUT_QUANTITY(65)%SHORT_NAME = 'sres'
OUTPUT_QUANTITY(65)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(65)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(66)%NAME = 'SCARC ITERATIONS'
OUTPUT_QUANTITY(66)%UNITS = ' '
OUTPUT_QUANTITY(66)%SHORT_NAME = 'sits'
OUTPUT_QUANTITY(66)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(66)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(67)%NAME = 'SCARC CONVERGENCE RATE'
OUTPUT_QUANTITY(67)%UNITS = ' '
OUTPUT_QUANTITY(67)%SHORT_NAME = 'srate'
OUTPUT_QUANTITY(67)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(67)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(68)%NAME = 'SPECIFIC INTERNAL ENERGY'
OUTPUT_QUANTITY(68)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(68)%SHORT_NAME = 'u'

OUTPUT_QUANTITY(69)%NAME = 'INTERNAL ENERGY'
OUTPUT_QUANTITY(69)%UNITS = 'kJ/m3'
OUTPUT_QUANTITY(69)%SHORT_NAME = 'U'

! Numerical stability parameters

OUTPUT_QUANTITY(70)%NAME = 'CFL'
OUTPUT_QUANTITY(70)%UNITS = ' '
OUTPUT_QUANTITY(70)%SHORT_NAME = 'CFL'

OUTPUT_QUANTITY(71)%NAME = 'VN'
OUTPUT_QUANTITY(71)%UNITS = ' '
OUTPUT_QUANTITY(71)%SHORT_NAME = 'VN'

OUTPUT_QUANTITY(72)%NAME = 'CFL MAX'
OUTPUT_QUANTITY(72)%UNITS = ' '
OUTPUT_QUANTITY(72)%SHORT_NAME = 'CFL'
OUTPUT_QUANTITY(72)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(72)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(72)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(73)%NAME = 'VN MAX'
OUTPUT_QUANTITY(73)%UNITS = ' '
OUTPUT_QUANTITY(73)%SHORT_NAME = 'VN'
OUTPUT_QUANTITY(73)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(73)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(73)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(74)%NAME = 'POISSON ERROR'
OUTPUT_QUANTITY(74)%UNITS = '1/s'
OUTPUT_QUANTITY(74)%SHORT_NAME = 'pois_err'
OUTPUT_QUANTITY(74)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(74)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(74)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(74)%TIME_AVERAGED    = .FALSE.

OUTPUT_QUANTITY(75)%NAME = 'DIVERGENCE ERROR'
OUTPUT_QUANTITY(75)%UNITS = '1/s'
OUTPUT_QUANTITY(75)%SHORT_NAME = 'div_err'
OUTPUT_QUANTITY(75)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(75)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(75)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(75)%TIME_AVERAGED    = .FALSE.

! Radial velocity pointing towards the vertical z axis (cylindrical coordinates)

OUTPUT_QUANTITY(76)%NAME  = 'RADIAL VELOCITY'
OUTPUT_QUANTITY(76)%UNITS  = 'm/s'
OUTPUT_QUANTITY(76)%SHORT_NAME  = 'U_R'

! Level Set

OUTPUT_QUANTITY(77)%NAME = 'LEVEL SET VALUE'
OUTPUT_QUANTITY(77)%UNITS = ' '
OUTPUT_QUANTITY(77)%SHORT_NAME = 'phi'

! Cell indices (for Smokeview debugging)

OUTPUT_QUANTITY(80)%NAME = 'CELL INDEX I'
OUTPUT_QUANTITY(80)%UNITS = ' '
OUTPUT_QUANTITY(80)%SHORT_NAME = 'i'

OUTPUT_QUANTITY(81)%NAME = 'CELL INDEX J'
OUTPUT_QUANTITY(81)%UNITS = ' '
OUTPUT_QUANTITY(81)%SHORT_NAME = 'j'

OUTPUT_QUANTITY(82)%NAME = 'CELL INDEX K'
OUTPUT_QUANTITY(82)%UNITS = ' '
OUTPUT_QUANTITY(82)%SHORT_NAME = 'k'

! Kolmogorov length scale

OUTPUT_QUANTITY(83)%NAME = 'Q CRITERION'
OUTPUT_QUANTITY(83)%UNITS = '1/s2'
OUTPUT_QUANTITY(83)%SHORT_NAME = 'Qcr'

OUTPUT_QUANTITY(84)%NAME = 'STRAIN RATE'
OUTPUT_QUANTITY(84)%UNITS = '1/s'
OUTPUT_QUANTITY(84)%SHORT_NAME = '|S|'

OUTPUT_QUANTITY(85)%NAME = 'KOLMOGOROV LENGTH SCALE'
OUTPUT_QUANTITY(85)%UNITS = 'm'
OUTPUT_QUANTITY(85)%SHORT_NAME = 'eta'

OUTPUT_QUANTITY(86)%NAME = 'CELL REYNOLDS NUMBER'
OUTPUT_QUANTITY(86)%UNITS = ' '
OUTPUT_QUANTITY(86)%SHORT_NAME = 'dx/eta'

OUTPUT_QUANTITY(87)%NAME = 'MOLECULAR VISCOSITY'
OUTPUT_QUANTITY(87)%UNITS = 'kg/m/s'
OUTPUT_QUANTITY(87)%SHORT_NAME = 'mu dns'

OUTPUT_QUANTITY(88)%NAME = 'DISSIPATION RATE'
OUTPUT_QUANTITY(88)%UNITS = 'm2/s3'
OUTPUT_QUANTITY(88)%SHORT_NAME = 'epsilon'

OUTPUT_QUANTITY(89)%NAME = 'KINEMATIC VISCOSITY'
OUTPUT_QUANTITY(89)%UNITS = 'm2/s'
OUTPUT_QUANTITY(89)%SHORT_NAME = 'nu eff'

! Species-specific quantities that require a SPEC_ID

OUTPUT_QUANTITY(90)%NAME='MASS FRACTION'
OUTPUT_QUANTITY(90)%UNITS='kg/kg'
OUTPUT_QUANTITY(90)%MASS_FRACTION = .TRUE.
OUTPUT_QUANTITY(90)%SHORT_NAME = 'Y'

OUTPUT_QUANTITY(91)%NAME = 'MASS FLUX X'
OUTPUT_QUANTITY(91)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(91)%SHORT_NAME = 'u*rho*Y'
OUTPUT_QUANTITY(91)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(91)%IOR = 1

OUTPUT_QUANTITY(92)%NAME = 'MASS FLUX Y'
OUTPUT_QUANTITY(92)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(92)%SHORT_NAME = 'v*rho*Y'
OUTPUT_QUANTITY(92)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(92)%IOR = 2

OUTPUT_QUANTITY(93)%NAME = 'MASS FLUX Z'
OUTPUT_QUANTITY(93)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(93)%SHORT_NAME = 'w*rho*Y'
OUTPUT_QUANTITY(93)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(93)%IOR = 3

OUTPUT_QUANTITY(94)%NAME = 'VOLUME FRACTION'
OUTPUT_QUANTITY(94)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(94)%SHORT_NAME = 'X'

OUTPUT_QUANTITY(95)%NAME = 'VISIBILITY'
OUTPUT_QUANTITY(95)%UNITS = 'm'
OUTPUT_QUANTITY(95)%SHORT_NAME = 'VIS'

OUTPUT_QUANTITY(96)%NAME = 'AEROSOL VOLUME FRACTION'
OUTPUT_QUANTITY(96)%UNITS = ' '
OUTPUT_QUANTITY(96)%SHORT_NAME = 'f_v'

OUTPUT_QUANTITY(97)%NAME = 'EXTINCTION COEFFICIENT'
OUTPUT_QUANTITY(97)%UNITS = '1/m'
OUTPUT_QUANTITY(97)%SHORT_NAME = 'ext_coef'

OUTPUT_QUANTITY(98)%NAME = 'OPTICAL DENSITY'
OUTPUT_QUANTITY(98)%UNITS = '1/m'
OUTPUT_QUANTITY(98)%SHORT_NAME = 'OD'

OUTPUT_QUANTITY(90:98)%SPEC_ID_REQUIRED = .TRUE.

! Miscellaneous

OUTPUT_QUANTITY(100)%NAME  = 'PRESSURE ZONE'
OUTPUT_QUANTITY(100)%UNITS  = ' '
OUTPUT_QUANTITY(100)%SHORT_NAME  = 'zone'

! Fractional Incapacitating Concentration (FIC)

OUTPUT_QUANTITY(101)%NAME  = 'FIC'
OUTPUT_QUANTITY(101)%UNITS = ''
OUTPUT_QUANTITY(101)%SHORT_NAME  = 'fic'
OUTPUT_QUANTITY(101)%SLCF_APPROPRIATE = .TRUE.

! Fractional Effective Dose (FED) inverse integrand as minutes

OUTPUT_QUANTITY(102)%NAME  = 'INCAPACITATION TIME'
OUTPUT_QUANTITY(102)%UNITS = 'min'
OUTPUT_QUANTITY(102)%SHORT_NAME  = 'inc time'
OUTPUT_QUANTITY(102)%SLCF_APPROPRIATE = .TRUE.

! Integrated Quantities

OUTPUT_QUANTITY(104)%NAME  = 'HRR'
OUTPUT_QUANTITY(104)%UNITS  = 'kW'
OUTPUT_QUANTITY(104)%SHORT_NAME  = 'hrr'

OUTPUT_QUANTITY(105)%NAME  = 'LAYER HEIGHT'
OUTPUT_QUANTITY(105)%UNITS  = 'm'
OUTPUT_QUANTITY(105)%SHORT_NAME  = 'layer'

OUTPUT_QUANTITY(106)%NAME  = 'UPPER TEMPERATURE'
OUTPUT_QUANTITY(106)%UNITS  = 'C'
OUTPUT_QUANTITY(106)%SHORT_NAME  = 'u-tmp'

OUTPUT_QUANTITY(107)%NAME  = 'LOWER TEMPERATURE'
OUTPUT_QUANTITY(107)%UNITS  = 'C'
OUTPUT_QUANTITY(107)%SHORT_NAME  = 'l-tmp'

OUTPUT_QUANTITY(103:107)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(103:107)%SLCF_APPROPRIATE = .FALSE.

! Fractional Effective Dose (FED)

OUTPUT_QUANTITY(109)%NAME  = 'FED'
OUTPUT_QUANTITY(109)%UNITS = ''
OUTPUT_QUANTITY(109)%SHORT_NAME  = 'fed'
OUTPUT_QUANTITY(109)%SLCF_APPROPRIATE = .FALSE.

! Model of a TC

OUTPUT_QUANTITY(110)%NAME  = 'THERMOCOUPLE'
OUTPUT_QUANTITY(110)%UNITS = 'C'
OUTPUT_QUANTITY(110)%SHORT_NAME  = 'tc'

! Mass and Energy Flows

OUTPUT_QUANTITY(111)%NAME  = 'VOLUME FLOW'
OUTPUT_QUANTITY(111)%UNITS  = 'm3/s'
OUTPUT_QUANTITY(111)%SHORT_NAME  = 'vflow'

OUTPUT_QUANTITY(112)%NAME  = 'MASS FLOW'
OUTPUT_QUANTITY(112)%UNITS  = 'kg/s'
OUTPUT_QUANTITY(112)%SHORT_NAME  = 'mflow'

OUTPUT_QUANTITY(113)%NAME  = 'HEAT FLOW'
OUTPUT_QUANTITY(113)%UNITS = 'kW'
OUTPUT_QUANTITY(113)%SHORT_NAME  = 'hflow'

OUTPUT_QUANTITY(114)%NAME  = 'VOLUME FLOW +'
OUTPUT_QUANTITY(114)%UNITS  = 'm3/s'
OUTPUT_QUANTITY(114)%SHORT_NAME  = 'vflow+'

OUTPUT_QUANTITY(115)%NAME  = 'MASS FLOW +'
OUTPUT_QUANTITY(115)%UNITS  = 'kg/s'
OUTPUT_QUANTITY(115)%SHORT_NAME  = 'mflow+'

OUTPUT_QUANTITY(116)%NAME  = 'HEAT FLOW +'
OUTPUT_QUANTITY(116)%UNITS  = 'kW'
OUTPUT_QUANTITY(116)%SHORT_NAME  = 'hflow+'

OUTPUT_QUANTITY(117)%NAME  = 'VOLUME FLOW -'
OUTPUT_QUANTITY(117)%UNITS  = 'm3/s'
OUTPUT_QUANTITY(117)%SHORT_NAME  = 'vflow-'

OUTPUT_QUANTITY(118)%NAME  = 'MASS FLOW -'
OUTPUT_QUANTITY(118)%UNITS  = 'kg/s'
OUTPUT_QUANTITY(118)%SHORT_NAME  = 'mflow-'

OUTPUT_QUANTITY(119)%NAME  = 'HEAT FLOW -'
OUTPUT_QUANTITY(119)%UNITS  = 'kW'
OUTPUT_QUANTITY(119)%SHORT_NAME  = 'hflow-'

OUTPUT_QUANTITY(111:119)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(111:119)%SLCF_APPROPRIATE = .FALSE.

! Special integration of HRRPUV

OUTPUT_QUANTITY(120)%NAME  = 'HRRPUL'
OUTPUT_QUANTITY(120)%UNITS  = 'kW/m'
OUTPUT_QUANTITY(120)%SHORT_NAME  = 'hrrpul'

OUTPUT_QUANTITY(121)%NAME  = 'RHRRPUL'
OUTPUT_QUANTITY(121)%UNITS  = 'kW/m'
OUTPUT_QUANTITY(121)%SHORT_NAME  = 'rhrrpul'

OUTPUT_QUANTITY(120:121)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(120:121)%SLCF_APPROPRIATE = .TRUE.

! Special Outputs for Partially Stirred Batch Reactor Model

OUTPUT_QUANTITY(130)%NAME  = 'EXTINCTION'
OUTPUT_QUANTITY(130)%UNITS  = ''
OUTPUT_QUANTITY(130)%SHORT_NAME  = 'extinct'

OUTPUT_QUANTITY(131)%NAME  = 'CHEMISTRY SUBITERATIONS'
OUTPUT_QUANTITY(131)%UNITS  = ''
OUTPUT_QUANTITY(131)%SHORT_NAME  = 'chem it'

OUTPUT_QUANTITY(132)%NAME  = 'REAC SOURCE TERM'
OUTPUT_QUANTITY(132)%UNITS  = 'kg/m3/s'
OUTPUT_QUANTITY(132)%SHORT_NAME  = 'reac source'
OUTPUT_QUANTITY(132)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(133)%NAME  = 'SUM LUMPED MASS FRACTIONS'
OUTPUT_QUANTITY(133)%UNITS  = ''
OUTPUT_QUANTITY(133)%SHORT_NAME  = 'sum Z'

OUTPUT_QUANTITY(134)%NAME  = 'SUM PRIMITIVE MASS FRACTIONS'
OUTPUT_QUANTITY(134)%UNITS  = ''
OUTPUT_QUANTITY(134)%SHORT_NAME  = 'sum Y'

OUTPUT_QUANTITY(135)%NAME  = 'MACH NUMBER'
OUTPUT_QUANTITY(135)%UNITS  = ''
OUTPUT_QUANTITY(135)%SHORT_NAME  = 'c'

OUTPUT_QUANTITY(136)%NAME  = 'UNMIXED FRACTION'
OUTPUT_QUANTITY(136)%UNITS  = ''
OUTPUT_QUANTITY(136)%SHORT_NAME  = 'zeta'

OUTPUT_QUANTITY(138)%NAME  = 'HRRPUV REAC'
OUTPUT_QUANTITY(138)%UNITS  = 'kW/m3'
OUTPUT_QUANTITY(138)%SHORT_NAME  = 'hrrpuv'

OUTPUT_QUANTITY(139)%NAME  = 'H PRIME'
OUTPUT_QUANTITY(139)%UNITS  = 'm2/s2'
OUTPUT_QUANTITY(139)%SHORT_NAME  = 'hp'

OUTPUT_QUANTITY(140)%NAME  = 'FVX_B'
OUTPUT_QUANTITY(140)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(140)%SHORT_NAME  = 'fvx_b'
OUTPUT_QUANTITY(140)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(140)%IOR = 1

OUTPUT_QUANTITY(141)%NAME  = 'FVY_B'
OUTPUT_QUANTITY(141)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(141)%SHORT_NAME  = 'fvy_b'
OUTPUT_QUANTITY(141)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(141)%IOR = 2

OUTPUT_QUANTITY(142)%NAME  = 'FVZ_B'
OUTPUT_QUANTITY(142)%UNITS  = 'm/s2'
OUTPUT_QUANTITY(142)%SHORT_NAME  = 'fvz_b'
OUTPUT_QUANTITY(142)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(142)%IOR = 3

OUTPUT_QUANTITY(143)%NAME  = 'COMBUSTION EFFICIENCY'
OUTPUT_QUANTITY(143)%UNITS  = ''
OUTPUT_QUANTITY(143)%SHORT_NAME  = 'eta'

! Sprinklers and Detectors

OUTPUT_QUANTITY(153)%NAME = 'NOZZLE FLOW RATE'
OUTPUT_QUANTITY(153)%UNITS = 'L/min'
OUTPUT_QUANTITY(153)%SHORT_NAME = 'flow'
OUTPUT_QUANTITY(153)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(154)%NAME = 'TRANSMISSION'
OUTPUT_QUANTITY(154)%UNITS = '%/m'
OUTPUT_QUANTITY(154)%SHORT_NAME = 'trans'
OUTPUT_QUANTITY(154)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(154)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(155)%NAME = 'PATH OBSCURATION'
OUTPUT_QUANTITY(155)%UNITS = '%'
OUTPUT_QUANTITY(155)%SHORT_NAME = 'total obs'
OUTPUT_QUANTITY(155)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(155)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(156)%NAME = 'SPRINKLER LINK TEMPERATURE'
OUTPUT_QUANTITY(156)%UNITS = 'C'
OUTPUT_QUANTITY(156)%SHORT_NAME = 'link'
OUTPUT_QUANTITY(156)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(157)%NAME = 'LINK TEMPERATURE'
OUTPUT_QUANTITY(157)%UNITS = 'C'
OUTPUT_QUANTITY(157)%SHORT_NAME = 'link'
OUTPUT_QUANTITY(157)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(158)%NAME = 'CHAMBER OBSCURATION'
OUTPUT_QUANTITY(158)%UNITS = '%/m'
OUTPUT_QUANTITY(158)%SHORT_NAME = 'obs'
OUTPUT_QUANTITY(158)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(159)%NAME = 'CONTROL VALUE'
OUTPUT_QUANTITY(159)%UNITS = ' '
OUTPUT_QUANTITY(159)%SHORT_NAME = 'output'
OUTPUT_QUANTITY(159)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(159)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(160)%NAME = 'CONTROL'
OUTPUT_QUANTITY(160)%UNITS = ' '
OUTPUT_QUANTITY(160)%SHORT_NAME = 'state'
OUTPUT_QUANTITY(160)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(160)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(161)%NAME = 'ASPIRATION'
OUTPUT_QUANTITY(161)%UNITS = '%/m'
OUTPUT_QUANTITY(161)%SHORT_NAME = 'obs'
OUTPUT_QUANTITY(161)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(162)%NAME = 'ASSUMED GAS TEMPERATURE'
OUTPUT_QUANTITY(162)%UNITS = 'C'
OUTPUT_QUANTITY(162)%SHORT_NAME = 'agt'

OUTPUT_QUANTITY(163)%NAME = 'PATHLENGTH'
OUTPUT_QUANTITY(163)%UNITS = 'm'
OUTPUT_QUANTITY(163)%SHORT_NAME = 'L'
OUTPUT_QUANTITY(163)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(163)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(165)%NAME = 'VELOCITY PATCH'
OUTPUT_QUANTITY(165)%UNITS = ' '
OUTPUT_QUANTITY(165)%SHORT_NAME = 'vel_patch'
OUTPUT_QUANTITY(165)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%INTEGRATED = .TRUE.

! PARTICLE mass quantities

OUTPUT_QUANTITY(170)%NAME = 'MPUV'
OUTPUT_QUANTITY(170)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(170)%SHORT_NAME = 'mpuv'

OUTPUT_QUANTITY(171)%NAME = 'ADD'
OUTPUT_QUANTITY(171)%UNITS = 'mu-m'
OUTPUT_QUANTITY(171)%SHORT_NAME = 'diam'

OUTPUT_QUANTITY(172)%NAME = 'ADT'
OUTPUT_QUANTITY(172)%UNITS = 'C'
OUTPUT_QUANTITY(172)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(173)%NAME = 'ADA'
OUTPUT_QUANTITY(173)%UNITS = 'm2/m3'
OUTPUT_QUANTITY(173)%SHORT_NAME = 'area'

OUTPUT_QUANTITY(174)%NAME = 'QABS'
OUTPUT_QUANTITY(174)%UNITS = ''
OUTPUT_QUANTITY(174)%SHORT_NAME = 'q_abs'

OUTPUT_QUANTITY(175)%NAME = 'QSCA'
OUTPUT_QUANTITY(175)%UNITS = ''
OUTPUT_QUANTITY(175)%SHORT_NAME = 'q_sca'

OUTPUT_QUANTITY(170:175)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(170:175)%PART_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(176)%NAME = 'PARTICLE FLUX X'
OUTPUT_QUANTITY(176)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(176)%SHORT_NAME = 'flux_x'

OUTPUT_QUANTITY(177)%NAME = 'PARTICLE FLUX Y'
OUTPUT_QUANTITY(177)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(177)%SHORT_NAME = 'flux_y'

OUTPUT_QUANTITY(178)%NAME = 'PARTICLE FLUX Z'
OUTPUT_QUANTITY(178)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(178)%SHORT_NAME = 'flux_z'

OUTPUT_QUANTITY(176:178)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(176:178)%INTEGRATED_PARTICLES = .TRUE.

OUTPUT_QUANTITY(179)%NAME = 'MPUV_Z'
OUTPUT_QUANTITY(179)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(179)%SHORT_NAME = 'mpuv_z'

OUTPUT_QUANTITY(180)%NAME = 'ADD_Z'
OUTPUT_QUANTITY(180)%UNITS = 'mu-m'
OUTPUT_QUANTITY(180)%SHORT_NAME = 'diam_z'

OUTPUT_QUANTITY(181)%NAME = 'ADT_Z'
OUTPUT_QUANTITY(181)%UNITS = 'C'
OUTPUT_QUANTITY(181)%SHORT_NAME = 'temp_z'

OUTPUT_QUANTITY(182)%NAME = 'ADA_Z'
OUTPUT_QUANTITY(182)%UNITS = 'm2/m3'
OUTPUT_QUANTITY(182)%SHORT_NAME = 'area_z'

OUTPUT_QUANTITY(183)%NAME = 'QABS_Z'
OUTPUT_QUANTITY(183)%UNITS = ''
OUTPUT_QUANTITY(183)%SHORT_NAME = 'q_abs_z'

OUTPUT_QUANTITY(184)%NAME = 'QSCA_Z'
OUTPUT_QUANTITY(184)%UNITS = ''
OUTPUT_QUANTITY(184)%SHORT_NAME = 'q_sca_z'

OUTPUT_QUANTITY(180:184)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(180:184)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(185)%NAME = 'NUMBER OF PARTICLES'
OUTPUT_QUANTITY(185)%UNITS = '#'
OUTPUT_QUANTITY(185)%SHORT_NAME = 'NLP'
OUTPUT_QUANTITY(185)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(185)%SLCF_APPROPRIATE = .FALSE.

! Geometry output
OUTPUT_QUANTITY(190)%NAME = 'CELL PHASE'
OUTPUT_QUANTITY(190)%UNITS = ''
OUTPUT_QUANTITY(190)%SHORT_NAME = 'Cell'
OUTPUT_QUANTITY(190)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(190)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(190)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(190)%SPEC_ID_REQUIRED = .FALSE.

! PDPA

OUTPUT_QUANTITY(230)%NAME = 'RANDOM NUMBER'
OUTPUT_QUANTITY(230)%UNITS = ' '
OUTPUT_QUANTITY(230)%SHORT_NAME = ' '
OUTPUT_QUANTITY(230)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(230)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(230)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(230)%TIME_AVERAGED    = .FALSE.

OUTPUT_QUANTITY(231)%NAME = 'PDPA'
OUTPUT_QUANTITY(231)%UNITS = ' '
OUTPUT_QUANTITY(231)%SHORT_NAME = ' '
OUTPUT_QUANTITY(231)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(231)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(231)%SLCF_APPROPRIATE = .FALSE.

! EVAC

OUTPUT_QUANTITY(240:250)%SLCF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(240:250)%ISOF_APPROPRIATE=.FALSE.

OUTPUT_QUANTITY(240)%NAME       = 'HUMAN_MOTIVE_ACCELERATION'
OUTPUT_QUANTITY(240)%UNITS      = 'm/s2'
OUTPUT_QUANTITY(240)%SHORT_NAME = 'motiveAcc'

OUTPUT_QUANTITY(241)%NAME       = 'HUMAN_FED_DOSE'
OUTPUT_QUANTITY(241)%UNITS      = '  '
OUTPUT_QUANTITY(241)%SHORT_NAME = 'FED'

OUTPUT_QUANTITY(242)%NAME       = 'HUMAN_SPEED'
OUTPUT_QUANTITY(242)%UNITS      = 'm/s'
OUTPUT_QUANTITY(242)%SHORT_NAME = 'speed'

OUTPUT_QUANTITY(243)%NAME       = 'HUMAN_ANGULAR_SPEED'
OUTPUT_QUANTITY(243)%UNITS      = 'rad/s'
OUTPUT_QUANTITY(243)%SHORT_NAME = 'omega'

OUTPUT_QUANTITY(244)%NAME       = 'HUMAN_ACCELERATION'
OUTPUT_QUANTITY(244)%UNITS      = 'm/s2'
OUTPUT_QUANTITY(244)%SHORT_NAME = 'acc'

OUTPUT_QUANTITY(245)%NAME       = 'HUMAN_CONTACT_LINEFORCE'
OUTPUT_QUANTITY(245)%UNITS      = 'N'
OUTPUT_QUANTITY(245)%SHORT_NAME = 'force_c'

OUTPUT_QUANTITY(246)%NAME       = 'HUMAN_TOTAL_LINEFORCE'
OUTPUT_QUANTITY(246)%UNITS      = 'N'
OUTPUT_QUANTITY(246)%SHORT_NAME = 'force_tot'

OUTPUT_QUANTITY(247)%NAME       = 'HUMAN_COLOR'
OUTPUT_QUANTITY(247)%UNITS      = '  '
OUTPUT_QUANTITY(247)%SHORT_NAME = 'color'

OUTPUT_QUANTITY(248)%NAME       = 'HUMAN_MOTIVE_ANGLE'
OUTPUT_QUANTITY(248)%UNITS      = 'rad'
OUTPUT_QUANTITY(248)%SHORT_NAME = 'mAngle'

OUTPUT_QUANTITY(249)%NAME       = 'HUMAN_DENSITY'
OUTPUT_QUANTITY(249)%UNITS      = '1/m2'
OUTPUT_QUANTITY(249)%SHORT_NAME = 'density'

OUTPUT_QUANTITY(250)%NAME       = 'HUMAN_NERVOUSNESS'
OUTPUT_QUANTITY(250)%UNITS      = '  '
OUTPUT_QUANTITY(250)%SHORT_NAME = 'nervous'

! Wind Chill Index

OUTPUT_QUANTITY(251)%NAME  = 'WIND CHILL INDEX'
OUTPUT_QUANTITY(251)%UNITS = 'C'
OUTPUT_QUANTITY(251)%SHORT_NAME  = 'WCI'
OUTPUT_QUANTITY(251)%SLCF_APPROPRIATE=.TRUE.
OUTPUT_QUANTITY(251)%ISOF_APPROPRIATE=.FALSE.

! HVAC

OUTPUT_QUANTITY(300:350)%SLCF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(300:350)%ISOF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(300:350)%GAS_PHASE=.FALSE.
OUTPUT_QUANTITY(300:350)%HVAC=.TRUE.

OUTPUT_QUANTITY(300)%NAME = 'DUCT VELOCITY'
OUTPUT_QUANTITY(300)%UNITS = 'm/s'
OUTPUT_QUANTITY(300)%SHORT_NAME = 'vel_d'
OUTPUT_QUANTITY(300)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(301)%NAME = 'DUCT TEMPERATURE'
OUTPUT_QUANTITY(301)%UNITS = 'C'
OUTPUT_QUANTITY(301)%SHORT_NAME = 'temp_d'
OUTPUT_QUANTITY(301)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(302)%NAME = 'DUCT MASS FLOW'
OUTPUT_QUANTITY(302)%UNITS = 'kg/s'
OUTPUT_QUANTITY(302)%SHORT_NAME = 'mot_d'
OUTPUT_QUANTITY(302)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(303)%NAME = 'DUCT VOLUME FLOW'
OUTPUT_QUANTITY(303)%UNITS = 'm3/s'
OUTPUT_QUANTITY(303)%SHORT_NAME = 'vdot_d'
OUTPUT_QUANTITY(303)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(304)%NAME = 'DUCT MASS FRACTION'
OUTPUT_QUANTITY(304)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(304)%SHORT_NAME = 'Y_d'
OUTPUT_QUANTITY(304)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(304)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(305)%NAME = 'DUCT VOLUME FRACTION'
OUTPUT_QUANTITY(305)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(305)%SHORT_NAME = 'X_d'
OUTPUT_QUANTITY(305)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(305)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(306)%NAME = 'DUCT DENSITY'
OUTPUT_QUANTITY(306)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(306)%SHORT_NAME = 'rho_d'
OUTPUT_QUANTITY(306)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(307)%NAME = 'DUCT CELL TEMPERATURE'
OUTPUT_QUANTITY(307)%UNITS = 'C'
OUTPUT_QUANTITY(307)%SHORT_NAME = 'temp_d_c'
OUTPUT_QUANTITY(307)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(307)%CELL_L_REQUIRED=.TRUE.

OUTPUT_QUANTITY(308)%NAME = 'DUCT CELL DENSITY'
OUTPUT_QUANTITY(308)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(308)%SHORT_NAME = 'rho_d_c'
OUTPUT_QUANTITY(308)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(308)%CELL_L_REQUIRED=.TRUE.

OUTPUT_QUANTITY(309)%NAME = 'DUCT CELL MASS FRACTION'
OUTPUT_QUANTITY(309)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(309)%SHORT_NAME = 'Y_d_c'
OUTPUT_QUANTITY(309)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(309)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(309)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(310)%NAME = 'DUCT CELL VOLUME FRACTION'
OUTPUT_QUANTITY(310)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(310)%SHORT_NAME = 'X_d_c'
OUTPUT_QUANTITY(310)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(310)%CELL_L_REQUIRED=.TRUE.
OUTPUT_QUANTITY(310)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(311)%NAME = 'DUCT ENERGY FLOW'
OUTPUT_QUANTITY(311)%UNITS = 'kW'
OUTPUT_QUANTITY(311)%SHORT_NAME = 'edot_d'
OUTPUT_QUANTITY(311)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(330)%NAME = 'NODE PRESSURE'
OUTPUT_QUANTITY(330)%UNITS = 'Pa'
OUTPUT_QUANTITY(330)%SHORT_NAME = 'P_n'
OUTPUT_QUANTITY(330)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(331)%NAME = 'NODE DENSITY'
OUTPUT_QUANTITY(331)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(331)%SHORT_NAME = 'rho_n'
OUTPUT_QUANTITY(331)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(332)%NAME = 'NODE TEMPERATURE'
OUTPUT_QUANTITY(332)%UNITS = 'C'
OUTPUT_QUANTITY(332)%SHORT_NAME = 'T_n'
OUTPUT_QUANTITY(332)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(333)%NAME = 'NODE MASS FRACTION'
OUTPUT_QUANTITY(333)%UNITS = 'kg/kg'
OUTPUT_QUANTITY(333)%SHORT_NAME = 'Y_n'
OUTPUT_QUANTITY(333)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(333)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(334)%NAME = 'NODE VOLUME FRACTION'
OUTPUT_QUANTITY(334)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(334)%SHORT_NAME = 'X_n'
OUTPUT_QUANTITY(334)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(334)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(335)%NAME = 'NODE PRESSURE DIFFERENCE'
OUTPUT_QUANTITY(335)%UNITS = 'Pa'
OUTPUT_QUANTITY(335)%SHORT_NAME = 'deltaP'
OUTPUT_QUANTITY(335)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(336)%NAME = 'FILTER LOADING'
OUTPUT_QUANTITY(336)%UNITS = 'kg'
OUTPUT_QUANTITY(336)%SHORT_NAME = 'Loading'
OUTPUT_QUANTITY(336)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(336)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(337)%NAME = 'AIRCOIL HEAT EXCHANGE'
OUTPUT_QUANTITY(337)%UNITS = 'kW'
OUTPUT_QUANTITY(337)%SHORT_NAME = 'aircq'
OUTPUT_QUANTITY(337)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(338)%NAME = 'FILTER LOSS'
OUTPUT_QUANTITY(338)%UNITS = ''
OUTPUT_QUANTITY(338)%SHORT_NAME = 'Loss'
OUTPUT_QUANTITY(338)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(339)%NAME = 'FAN PRESSURE'
OUTPUT_QUANTITY(339)%UNITS = 'Pa'
OUTPUT_QUANTITY(339)%SHORT_NAME = 'P_fan'
OUTPUT_QUANTITY(339)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(340)%NAME = 'NODE ENTHALPY'
OUTPUT_QUANTITY(340)%UNITS = 'kJ/kg'
OUTPUT_QUANTITY(340)%SHORT_NAME = 'h_n'
OUTPUT_QUANTITY(340)%NODE_ID_REQUIRED=.TRUE.

! QUANTITY's the refer to PARTICLE properties that are used to color the PARTICLEs in Smokeview

OUTPUT_QUANTITY(434)%NAME = 'PARTICLE DIAMETER'
OUTPUT_QUANTITY(434)%OLD_NAME = 'DROPLET_DIAMETER'
OUTPUT_QUANTITY(434)%UNITS = 'mu-m'
OUTPUT_QUANTITY(434)%SHORT_NAME = 'diam'

OUTPUT_QUANTITY(435)%NAME = 'PARTICLE VELOCITY'
OUTPUT_QUANTITY(435)%OLD_NAME = 'DROPLET_VELOCITY'
OUTPUT_QUANTITY(435)%UNITS = 'm/s'
OUTPUT_QUANTITY(435)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(436)%NAME = 'PARTICLE PHASE'
OUTPUT_QUANTITY(436)%UNITS = ' '
OUTPUT_QUANTITY(436)%SHORT_NAME = 'ior'

OUTPUT_QUANTITY(437)%NAME = 'PARTICLE TEMPERATURE'
OUTPUT_QUANTITY(437)%OLD_NAME = 'DROPLET_TEMPERATURE'
OUTPUT_QUANTITY(437)%UNITS = 'C'
OUTPUT_QUANTITY(437)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(438)%NAME = 'PARTICLE MASS'
OUTPUT_QUANTITY(438)%UNITS = 'kg'
OUTPUT_QUANTITY(438)%SHORT_NAME = 'mass'

OUTPUT_QUANTITY(439)%NAME = 'PARTICLE AGE'
OUTPUT_QUANTITY(439)%UNITS = 's'
OUTPUT_QUANTITY(439)%SHORT_NAME = 'age'

OUTPUT_QUANTITY(440)%NAME = 'PARTICLE WEIGHTING FACTOR'
OUTPUT_QUANTITY(440)%UNITS = ' '
OUTPUT_QUANTITY(440)%SHORT_NAME = 'pwt'

OUTPUT_QUANTITY(441)%NAME = 'PARTICLE X'
OUTPUT_QUANTITY(441)%UNITS = 'm'
OUTPUT_QUANTITY(441)%SHORT_NAME = 'x'

OUTPUT_QUANTITY(442)%NAME = 'PARTICLE Y'
OUTPUT_QUANTITY(442)%UNITS = 'm'
OUTPUT_QUANTITY(442)%SHORT_NAME = 'y'

OUTPUT_QUANTITY(443)%NAME = 'PARTICLE Z'
OUTPUT_QUANTITY(443)%UNITS = 'm'
OUTPUT_QUANTITY(443)%SHORT_NAME = 'z'

OUTPUT_QUANTITY(444)%NAME = 'PARTICLE U'
OUTPUT_QUANTITY(444)%UNITS = 'm/s'
OUTPUT_QUANTITY(444)%SHORT_NAME = 'u'

OUTPUT_QUANTITY(445)%NAME = 'PARTICLE V'
OUTPUT_QUANTITY(445)%UNITS = 'm/s'
OUTPUT_QUANTITY(445)%SHORT_NAME = 'v'

OUTPUT_QUANTITY(446)%NAME = 'PARTICLE W'
OUTPUT_QUANTITY(446)%UNITS = 'm/s'
OUTPUT_QUANTITY(446)%SHORT_NAME = 'w'

OUTPUT_QUANTITY(434:446)%PART_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(434:446)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(434:446)%DEVC_APPROPRIATE = .TRUE.

! Test outputs

OUTPUT_QUANTITY(500)%NAME = 'PRESSURE MMS'
OUTPUT_QUANTITY(500)%UNITS = 'Pa'
OUTPUT_QUANTITY(500)%SHORT_NAME = 'p_mms'

OUTPUT_QUANTITY(501)%NAME = 'H MMS'
OUTPUT_QUANTITY(501)%UNITS = '(m/s)^2'
OUTPUT_QUANTITY(501)%SHORT_NAME = 'h_mms'

OUTPUT_QUANTITY(502)%NAME = 'CHI_R'
OUTPUT_QUANTITY(502)%UNITS = 'kW/kW'
OUTPUT_QUANTITY(502)%SHORT_NAME = 'chi_r'

OUTPUT_QUANTITY(504)%NAME = 'CFL 1'
OUTPUT_QUANTITY(504)%UNITS = ''
OUTPUT_QUANTITY(504)%SHORT_NAME = 'cfl 1'

OUTPUT_QUANTITY(505)%NAME = 'CFL 3'
OUTPUT_QUANTITY(505)%UNITS = ''
OUTPUT_QUANTITY(505)%SHORT_NAME = 'cfl 3'

OUTPUT_QUANTITY(504:506)%DEVC_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(504:506)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(508)%NAME = 'IDEAL GAS PRESSURE'
OUTPUT_QUANTITY(508)%UNITS = 'Pa'
OUTPUT_QUANTITY(508)%SHORT_NAME = 'pbar'

OUTPUT_QUANTITY(510)%NAME = 'DUDT'
OUTPUT_QUANTITY(510)%UNITS = 'm/s2'
OUTPUT_QUANTITY(510)%SHORT_NAME = 'dudt'
OUTPUT_QUANTITY(510)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(510)%IOR = 1

OUTPUT_QUANTITY(511)%NAME = 'DVDT'
OUTPUT_QUANTITY(511)%UNITS = 'm/s2'
OUTPUT_QUANTITY(511)%SHORT_NAME = 'dvdt'
OUTPUT_QUANTITY(511)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(511)%IOR = 2

OUTPUT_QUANTITY(512)%NAME = 'DWDT'
OUTPUT_QUANTITY(512)%UNITS = 'm/s2'
OUTPUT_QUANTITY(512)%SHORT_NAME = 'dwdt'
OUTPUT_QUANTITY(512)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(512)%IOR = 3

OUTPUT_QUANTITY(513)%NAME = 'DHDX'
OUTPUT_QUANTITY(513)%UNITS = 'm/s2'
OUTPUT_QUANTITY(513)%SHORT_NAME = 'dHdx'
OUTPUT_QUANTITY(513)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(513)%IOR = 1

OUTPUT_QUANTITY(514)%NAME = 'DHDY'
OUTPUT_QUANTITY(514)%UNITS = 'm/s2'
OUTPUT_QUANTITY(514)%SHORT_NAME = 'dHdy'
OUTPUT_QUANTITY(514)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(514)%IOR = 2

OUTPUT_QUANTITY(515)%NAME = 'DHDZ'
OUTPUT_QUANTITY(515)%UNITS = 'm/s2'
OUTPUT_QUANTITY(515)%SHORT_NAME = 'dHdz'
OUTPUT_QUANTITY(515)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(515)%IOR = 3

OUTPUT_QUANTITY(510:515)%DEVC_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(510:515)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(520)%NAME = 'SOLID CELL Q_S'
OUTPUT_QUANTITY(520)%UNITS = 'kW/m3'
OUTPUT_QUANTITY(520)%SHORT_NAME = 'q_s'

OUTPUT_QUANTITY(521)%NAME = 'SOLID CELL DENSITY'
OUTPUT_QUANTITY(521)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(521)%SHORT_NAME = 'rho_s'
OUTPUT_QUANTITY(521)%MATL_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(522)%NAME = 'SOLID CELL VOLUME RATIO'
OUTPUT_QUANTITY(522)%UNITS = 'm3/m3'
OUTPUT_QUANTITY(522)%SHORT_NAME = 'Vs/Vc'

OUTPUT_QUANTITY(523)%NAME = 'ABSOLUTE PRESSURE'
OUTPUT_QUANTITY(523)%UNITS = 'PA'
OUTPUT_QUANTITY(523)%SHORT_NAME = 'P_abs'

OUTPUT_QUANTITY(524)%NAME = 'TURBULENT PRANDTL NUMBER'
OUTPUT_QUANTITY(524)%UNITS = ''
OUTPUT_QUANTITY(524)%SHORT_NAME = 'Pr_t'

OUTPUT_QUANTITY(525)%NAME = 'TRI CORRECTION'
OUTPUT_QUANTITY(525)%UNITS = ''
OUTPUT_QUANTITY(525)%SHORT_NAME = 'tri'

OUTPUT_QUANTITY(526)%NAME = 'FLAME TEMPERATURE'
OUTPUT_QUANTITY(526)%UNITS = 'C'
OUTPUT_QUANTITY(526)%SHORT_NAME = 'T_flame'

OUTPUT_QUANTITY(527)%NAME = 'FLAME INDEX'
OUTPUT_QUANTITY(527)%UNITS = ''
OUTPUT_QUANTITY(527)%SHORT_NAME = 'flame_index'

OUTPUT_QUANTITY(528)%NAME = 'ADVECTIVE MASS FLUX X'
OUTPUT_QUANTITY(528)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(528)%SHORT_NAME = 'rho*Z*u'
OUTPUT_QUANTITY(528)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(528)%IOR = 1
OUTPUT_QUANTITY(528)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(529)%NAME = 'ADVECTIVE MASS FLUX Y'
OUTPUT_QUANTITY(529)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(529)%SHORT_NAME = 'rho*Z*v'
OUTPUT_QUANTITY(529)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(529)%IOR = 2
OUTPUT_QUANTITY(529)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(530)%NAME = 'ADVECTIVE MASS FLUX Z'
OUTPUT_QUANTITY(530)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(530)%SHORT_NAME = 'rho*Z*w'
OUTPUT_QUANTITY(530)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(530)%IOR = 3
OUTPUT_QUANTITY(530)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(531)%NAME = 'DIFFUSIVE MASS FLUX X'
OUTPUT_QUANTITY(531)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(531)%SHORT_NAME = 'rho*D*dZ/dx'
OUTPUT_QUANTITY(531)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(531)%IOR = 1
OUTPUT_QUANTITY(531)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(532)%NAME = 'DIFFUSIVE MASS FLUX Y'
OUTPUT_QUANTITY(532)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(532)%SHORT_NAME = 'rho*D*dZ/dy'
OUTPUT_QUANTITY(532)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(532)%IOR = 2
OUTPUT_QUANTITY(532)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(533)%NAME = 'DIFFUSIVE MASS FLUX Z'
OUTPUT_QUANTITY(533)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(533)%SHORT_NAME = 'rho*D*dZ/dz'
OUTPUT_QUANTITY(533)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(533)%IOR = 3
OUTPUT_QUANTITY(533)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(534)%NAME = 'TOTAL MASS FLUX X'
OUTPUT_QUANTITY(534)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(534)%SHORT_NAME = 'rho*(Z*u + D*dZ/dx)'
OUTPUT_QUANTITY(534)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(534)%IOR = 1
OUTPUT_QUANTITY(534)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(535)%NAME = 'TOTAL MASS FLUX Y'
OUTPUT_QUANTITY(535)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(535)%SHORT_NAME = 'rho*(Z*v + D*dZ/dy)'
OUTPUT_QUANTITY(535)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(535)%IOR = 2
OUTPUT_QUANTITY(535)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(536)%NAME = 'TOTAL MASS FLUX Z'
OUTPUT_QUANTITY(536)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(536)%SHORT_NAME = 'rho*(Z*w + D*dZ/dz)'
OUTPUT_QUANTITY(536)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(536)%IOR = 3
OUTPUT_QUANTITY(536)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(537)%NAME = 'DIVERGENCE CORRECTION'
OUTPUT_QUANTITY(537)%UNITS = '1/s'
OUTPUT_QUANTITY(537)%SHORT_NAME = 'dcor'


! Boundary Quantities (Negative indices)

OUTPUT_QUANTITY(-1)%NAME = 'RADIATIVE HEAT FLUX'
OUTPUT_QUANTITY(-1)%OLD_NAME = 'RADIATIVE HEAT FLUX GAS'
OUTPUT_QUANTITY(-1)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-1)%SHORT_NAME = 'rad'

OUTPUT_QUANTITY(-2)%NAME = 'CONVECTIVE HEAT FLUX'
OUTPUT_QUANTITY(-2)%OLD_NAME = 'CONVECTIVE_FLUX'
OUTPUT_QUANTITY(-2)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-2)%SHORT_NAME = 'con'

OUTPUT_QUANTITY(-3)%NAME = 'NORMAL VELOCITY'
OUTPUT_QUANTITY(-3)%UNITS = 'm/s'
OUTPUT_QUANTITY(-3)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(-4)%NAME = 'GAS TEMPERATURE'
OUTPUT_QUANTITY(-4)%UNITS = 'C'
OUTPUT_QUANTITY(-4)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(-5)%NAME = 'WALL TEMPERATURE'
OUTPUT_QUANTITY(-5)%OLD_NAME = 'WALL_TEMPERATURE'
OUTPUT_QUANTITY(-5)%UNITS = 'C'
OUTPUT_QUANTITY(-5)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(-6)%NAME = 'INSIDE WALL TEMPERATURE'
OUTPUT_QUANTITY(-6)%OLD_NAME = 'INSIDE_WALL_TEMPERATURE'
OUTPUT_QUANTITY(-6)%UNITS = 'C'
OUTPUT_QUANTITY(-6)%SHORT_NAME = 'inside'
OUTPUT_QUANTITY(-6)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-6)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-7)%NAME = 'BURNING RATE'
OUTPUT_QUANTITY(-7)%OLD_NAME = 'BURNING_RATE'
OUTPUT_QUANTITY(-7)%UNITS = 'kg/m2/s'
OUTPUT_QUANTITY(-7)%SHORT_NAME = 'burn'

OUTPUT_QUANTITY(-8)%NAME = 'NORMALIZED HEAT RELEASE RATE'
OUTPUT_QUANTITY(-8)%UNITS = 'kW/kg'
OUTPUT_QUANTITY(-8)%SHORT_NAME = 'hrrpum'
OUTPUT_QUANTITY(-8)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-9)%NAME = 'HRRPUA'
OUTPUT_QUANTITY(-9)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-9)%SHORT_NAME = 'hrrpua'

OUTPUT_QUANTITY(-10)%NAME= 'NET HEAT FLUX'
OUTPUT_QUANTITY(-10)%OLD_NAME= 'HEAT_FLUX'
OUTPUT_QUANTITY(-10)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-10)%SHORT_NAME= 'net'

OUTPUT_QUANTITY(-11)%NAME= 'PRESSURE COEFFICIENT'
OUTPUT_QUANTITY(-11)%OLD_NAME= 'PRESSURE_COEFFICIENT'
OUTPUT_QUANTITY(-11)%UNITS= ' '
OUTPUT_QUANTITY(-11)%SHORT_NAME= 'c_p'

OUTPUT_QUANTITY(-12)%NAME= 'BACK WALL TEMPERATURE'
OUTPUT_QUANTITY(-12)%OLD_NAME= 'BACK_WALL_TEMPERATURE'
OUTPUT_QUANTITY(-12)%UNITS= 'C'
OUTPUT_QUANTITY(-12)%SHORT_NAME= 'back'

OUTPUT_QUANTITY(-13)%NAME= 'GAUGE HEAT FLUX'
OUTPUT_QUANTITY(-13)%OLD_NAME= 'GAUGE_HEAT_FLUX'
OUTPUT_QUANTITY(-13)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-13)%SHORT_NAME= 'gauge'

OUTPUT_QUANTITY(-14)%NAME = 'NORMALIZED HEATING RATE'
OUTPUT_QUANTITY(-14)%UNITS = 'W/g'
OUTPUT_QUANTITY(-14)%SHORT_NAME = 'DSC'
OUTPUT_QUANTITY(-14)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-15)%NAME = 'MASS FLUX'
OUTPUT_QUANTITY(-15)%OLD_NAME = 'MASS_FLUX'
OUTPUT_QUANTITY(-15)%UNITS= 'kg/s/m2'
OUTPUT_QUANTITY(-15)%SHORT_NAME = 'mass_flux'
OUTPUT_QUANTITY(-15)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-16)%NAME = 'NORMALIZED MASS LOSS RATE'
OUTPUT_QUANTITY(-16)%UNITS= '1/s'
OUTPUT_QUANTITY(-16)%SHORT_NAME = 'rr'
OUTPUT_QUANTITY(-16)%SPEC_ID_REQUIRED = .FALSE.
OUTPUT_QUANTITY(-16)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-17)%NAME = 'RADIANCE'
OUTPUT_QUANTITY(-17)%UNITS = 'kW/m2/sr'
OUTPUT_QUANTITY(-17)%SHORT_NAME = 'rad'
OUTPUT_QUANTITY(-17)%BNDF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(-17)%PART_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-20)%NAME= 'INCIDENT HEAT FLUX'
OUTPUT_QUANTITY(-20)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-20)%SHORT_NAME= 'in_flux'

OUTPUT_QUANTITY(-21)%NAME= 'HEAT TRANSFER COEFFICIENT'
OUTPUT_QUANTITY(-21)%UNITS= 'W/m2/K'
OUTPUT_QUANTITY(-21)%SHORT_NAME= 'h'

OUTPUT_QUANTITY(-22)%NAME= 'RADIOMETER'
OUTPUT_QUANTITY(-22)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-22)%SHORT_NAME= 'radio'

OUTPUT_QUANTITY(-23)%NAME= 'ADIABATIC SURFACE TEMPERATURE'
OUTPUT_QUANTITY(-23)%OLD_NAME= 'ADIABATIC SURFACE TEMPERATURE GAS'
OUTPUT_QUANTITY(-23)%UNITS= 'C'
OUTPUT_QUANTITY(-23)%SHORT_NAME= 'AST'
OUTPUT_QUANTITY(-23)%PART_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(-24)%NAME= 'WALL THICKNESS'
OUTPUT_QUANTITY(-24)%UNITS= 'm'
OUTPUT_QUANTITY(-24)%SHORT_NAME= 'thick'

OUTPUT_QUANTITY(-25)%NAME= 'SURFACE DENSITY'
OUTPUT_QUANTITY(-25)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-25)%SHORT_NAME= 'dens'

OUTPUT_QUANTITY(-26)%NAME= 'NORMALIZED MASS'
OUTPUT_QUANTITY(-26)%UNITS= 'kg/kg'
OUTPUT_QUANTITY(-26)%SHORT_NAME= 'm/m0'
OUTPUT_QUANTITY(-26)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-27)%NAME= 'SOLID DENSITY'
OUTPUT_QUANTITY(-27)%UNITS= 'kg/m3'
OUTPUT_QUANTITY(-27)%SHORT_NAME= 'rho_s'
OUTPUT_QUANTITY(-27)%MATL_ID_REQUIRED = .TRUE.
OUTPUT_QUANTITY(-27)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-27)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-28)%NAME= 'EMISSIVITY'
OUTPUT_QUANTITY(-28)%UNITS= ''
OUTPUT_QUANTITY(-28)%SHORT_NAME= 'emiss'

OUTPUT_QUANTITY(-29)%NAME= 'SURFACE DEPOSITION'
OUTPUT_QUANTITY(-29)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-29)%SHORT_NAME= 'depo'
OUTPUT_QUANTITY(-29)%SPEC_ID_REQUIRED=.TRUE.

! Solid Phase Particle Outputs

OUTPUT_QUANTITY(-30)%NAME = 'MPUA'
OUTPUT_QUANTITY(-30)%UNITS = 'kg/m2'
OUTPUT_QUANTITY(-30)%SHORT_NAME = 'mpua'

OUTPUT_QUANTITY(-31)%NAME = 'CPUA'
OUTPUT_QUANTITY(-31)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-31)%SHORT_NAME = 'cpua'

OUTPUT_QUANTITY(-32)%NAME = 'AMPUA'
OUTPUT_QUANTITY(-32)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-32)%SHORT_NAME = 'ampua'

OUTPUT_QUANTITY(-32:-30)%PART_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-33)%NAME= 'SOLID SPECIFIC HEAT'
OUTPUT_QUANTITY(-33)%UNITS= 'kJ/kg/K'
OUTPUT_QUANTITY(-33)%SHORT_NAME= 'cp_s'
OUTPUT_QUANTITY(-33)%INSIDE_SOLID = .TRUE.

OUTPUT_QUANTITY(-34)%NAME= 'SOLID CONDUCTIVITY'
OUTPUT_QUANTITY(-34)%UNITS= 'W/m/K'
OUTPUT_QUANTITY(-34)%SHORT_NAME= 'k_s'
OUTPUT_QUANTITY(-34)%INSIDE_SOLID = .TRUE.

OUTPUT_QUANTITY(-35)%NAME= 'VISCOUS WALL UNITS'
OUTPUT_QUANTITY(-35)%UNITS= ' '
OUTPUT_QUANTITY(-35)%SHORT_NAME= 'y+'

OUTPUT_QUANTITY(-36)%NAME= 'FRICTION VELOCITY'
OUTPUT_QUANTITY(-36)%UNITS= 'm/s'
OUTPUT_QUANTITY(-36)%SHORT_NAME= 'u_tau'

OUTPUT_QUANTITY(-37)%NAME= 'VELOCITY ERROR'
OUTPUT_QUANTITY(-37)%UNITS= 'm/s'
OUTPUT_QUANTITY(-37)%SHORT_NAME= 'verr'

OUTPUT_QUANTITY(-38)%NAME= 'WALL VISCOSITY'
OUTPUT_QUANTITY(-38)%UNITS= 'kg/m/s'
OUTPUT_QUANTITY(-38)%SHORT_NAME= 'mu_w'

OUTPUT_QUANTITY(-39)%NAME= 'DEPOSITION VELOCITY'
OUTPUT_QUANTITY(-39)%UNITS= 'm/s'
OUTPUT_QUANTITY(-39)%SHORT_NAME= 'v_dep'

OUTPUT_QUANTITY(-40)%NAME= 'PRESSURE COEFFICIENT TEST'
OUTPUT_QUANTITY(-40)%UNITS= ' '
OUTPUT_QUANTITY(-40)%SHORT_NAME= 'c_p'

OUTPUT_QUANTITY(-41)%NAME= 'WALL CELL COLOR'
OUTPUT_QUANTITY(-41)%UNITS= ' '
OUTPUT_QUANTITY(-41)%SHORT_NAME= 'wc'

OUTPUT_QUANTITY(-42)%NAME = 'MPUA_Z'
OUTPUT_QUANTITY(-42)%UNITS = 'kg/m2'
OUTPUT_QUANTITY(-42)%SHORT_NAME = 'mpua_z'

OUTPUT_QUANTITY(-43)%NAME = 'CPUA_Z'
OUTPUT_QUANTITY(-43)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-43)%SHORT_NAME = 'cpua_z'

OUTPUT_QUANTITY(-44)%NAME = 'AMPUA_Z'
OUTPUT_QUANTITY(-44)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-44)%SHORT_NAME = 'ampua_z'

OUTPUT_QUANTITY(-44:-42)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-45)%NAME= 'WALL CELL BOUNDARY TYPE'
OUTPUT_QUANTITY(-45)%UNITS= ' '
OUTPUT_QUANTITY(-45)%SHORT_NAME= 'bc type'

OUTPUT_QUANTITY(-46)%NAME= 'WALL CELL THERMAL BOUNDARY TYPE'
OUTPUT_QUANTITY(-46)%UNITS= ' '
OUTPUT_QUANTITY(-46)%SHORT_NAME= 'thermal bc'

OUTPUT_QUANTITY(-47)%NAME= 'INSIDE WALL DEPTH' ! for use with INSIDE WALL TEMPERATURE
OUTPUT_QUANTITY(-47)%UNITS= 'm'
OUTPUT_QUANTITY(-47)%SHORT_NAME= 'depth'
OUTPUT_QUANTITY(-47)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-47)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-50)%NAME = 'VOLUME FLOW WALL'
OUTPUT_QUANTITY(-50)%UNITS= 'm3/s'
OUTPUT_QUANTITY(-50)%SHORT_NAME = 'vflow_wall'
OUTPUT_QUANTITY(-50)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-51)%NAME = 'VOLUME FLOW WALL +'
OUTPUT_QUANTITY(-51)%UNITS= 'm3/s'
OUTPUT_QUANTITY(-51)%SHORT_NAME = 'vflow_wall+'
OUTPUT_QUANTITY(-51)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-52)%NAME = 'VOLUME FLOW WALL -'
OUTPUT_QUANTITY(-52)%UNITS= 'm3/s'
OUTPUT_QUANTITY(-52)%SHORT_NAME = 'vflow_wall-'
OUTPUT_QUANTITY(-52)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-53)%NAME = 'MASS FLOW WALL'
OUTPUT_QUANTITY(-53)%UNITS= 'kg/s'
OUTPUT_QUANTITY(-53)%SHORT_NAME = 'mflow_wall'
OUTPUT_QUANTITY(-53)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-54)%NAME = 'MASS FLOW WALL +'
OUTPUT_QUANTITY(-54)%UNITS= 'kg/s'
OUTPUT_QUANTITY(-54)%SHORT_NAME = 'mflow_wall+'
OUTPUT_QUANTITY(-54)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-55)%NAME = 'MASS FLOW WALL -'
OUTPUT_QUANTITY(-55)%UNITS= 'kg/s'
OUTPUT_QUANTITY(-55)%SHORT_NAME = 'mflow_wall-'
OUTPUT_QUANTITY(-55)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-56)%NAME = 'HEAT FLOW WALL'
OUTPUT_QUANTITY(-56)%UNITS= 'kW'
OUTPUT_QUANTITY(-56)%SHORT_NAME = 'hflow_wall'
OUTPUT_QUANTITY(-56)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-57)%NAME = 'HEAT FLOW WALL +'
OUTPUT_QUANTITY(-57)%UNITS= 'kW'
OUTPUT_QUANTITY(-57)%SHORT_NAME = 'hflow_wall+'
OUTPUT_QUANTITY(-57)%INTEGRATED = .TRUE.

OUTPUT_QUANTITY(-58)%NAME = 'HEAT FLOW WALL -'
OUTPUT_QUANTITY(-58)%UNITS= 'kW'
OUTPUT_QUANTITY(-58)%SHORT_NAME = 'hflow_wall-'
OUTPUT_QUANTITY(-58)%INTEGRATED = .TRUE.

! WALL FLOWs require a DEVICE
OUTPUT_QUANTITY(-58:-53)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-61)%NAME = 'GAS DENSITY'
OUTPUT_QUANTITY(-61)%UNITS= 'kg/m3'
OUTPUT_QUANTITY(-61)%SHORT_NAME = 'rho'

OUTPUT_QUANTITY(-62)%NAME = 'SOLID CELL TEMPERATURE'
OUTPUT_QUANTITY(-62)%UNITS= 'C'
OUTPUT_QUANTITY(-62)%SHORT_NAME = 'T_s'

OUTPUT_QUANTITY(-63)%NAME = 'THERMAL WALL UNITS'
OUTPUT_QUANTITY(-63)%UNITS= ' '
OUTPUT_QUANTITY(-63)%SHORT_NAME = 'z*'

OUTPUT_QUANTITY(-64)%NAME = 'MASS FLUX WALL'
OUTPUT_QUANTITY(-64)%UNITS= 'kg/s/m2'
OUTPUT_QUANTITY(-64)%SHORT_NAME = 'mflux_wall'

OUTPUT_QUANTITY(-65)%NAME = 'WALL PRESSURE'
OUTPUT_QUANTITY(-65)%UNITS= 'N/m2'
OUTPUT_QUANTITY(-65)%SHORT_NAME = 'p_n'

OUTPUT_QUANTITY(-66)%NAME = 'VISCOUS STRESS WALL'
OUTPUT_QUANTITY(-66)%UNITS= 'N/m2'
OUTPUT_QUANTITY(-66)%SHORT_NAME = 'tau_w'

OUTPUT_QUANTITY(-67)%NAME = 'WALL PRESSURE TEST'
OUTPUT_QUANTITY(-67)%UNITS= 'N/m2'
OUTPUT_QUANTITY(-67)%SHORT_NAME = 'p_n'

OUTPUT_QUANTITY(-68)%NAME = 'LEVEL SET'
OUTPUT_QUANTITY(-68)%UNITS= ''
OUTPUT_QUANTITY(-68)%SHORT_NAME = 'phi_ls'

OUTPUT_QUANTITY(-69)%NAME = 'WALL ENTHALPY'
OUTPUT_QUANTITY(-69)%UNITS= 'kJ'
OUTPUT_QUANTITY(-69)%SHORT_NAME = 'h_w'

OUTPUT_QUANTITY(-70)%NAME = 'SUBSTEPS'
OUTPUT_QUANTITY(-70)%UNITS= ' '
OUTPUT_QUANTITY(-70)%SHORT_NAME = 'sub'

! Condensation
OUTPUT_QUANTITY(-100)%NAME = 'CONDENSATION HEAT FLUX'
OUTPUT_QUANTITY(-100)%UNITS= 'kW/m2'
OUTPUT_QUANTITY(-100)%SHORT_NAME = 'q_cndns'
OUTPUT_QUANTITY(-100)%SPEC_ID_REQUIRED = .FALSE.
OUTPUT_QUANTITY(-100)%MATL_ID_REQUIRED = .FALSE.
OUTPUT_QUANTITY(-100)%INSIDE_SOLID = .FALSE.
OUTPUT_QUANTITY(-100)%BNDF_APPROPRIATE = .TRUE.

END SUBROUTINE DEFINE_OUTPUT_QUANTITIES


SUBROUTINE SET_QUANTITIES_AMBIENT
USE GLOBAL_CONSTANTS, ONLY: RHOA,TMPA,TMPM
! Define OUTPUT_QUANTITYs that have fixed names

OUTPUT_QUANTITY(1)%AMBIENT_VALUE = RHOA
OUTPUT_QUANTITY(5)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(110)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-6:-4)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-12)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-23)%AMBIENT_VALUE = TMPA-TMPM

END SUBROUTINE SET_QUANTITIES_AMBIENT


SUBROUTINE COLOR2RGB(RGB,COLOR)
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
! Translate character string of a color name to RGB value

INTEGER, INTENT(OUT) :: RGB(3)
CHARACTER(25), INTENT(IN) :: COLOR
CHARACTER(MESSAGE_LENGTH) :: MESSAGE
REAL :: RAN_NUM
INTEGER :: IC

SELECT CASE(COLOR)
CASE ('ALICE BLUE');RGB = (/240,248,255/)
CASE ('ANTIQUE WHITE');RGB = (/250,235,215/)
CASE ('ANTIQUE WHITE 1');RGB = (/255,239,219/)
CASE ('ANTIQUE WHITE 2');RGB = (/238,223,204/)
CASE ('ANTIQUE WHITE 3');RGB = (/205,192,176/)
CASE ('ANTIQUE WHITE 4');RGB = (/139,131,120/)
CASE ('AQUAMARINE');RGB = (/127,255,212/)
CASE ('AQUAMARINE 1');RGB = (/118,238,198/)
CASE ('AQUAMARINE 2');RGB = (/102,205,170/)
CASE ('AQUAMARINE 3');RGB = (/69,139,116/)
CASE ('AZURE');RGB = (/240,255,255/)
CASE ('AZURE 1');RGB = (/224,238,238/)
CASE ('AZURE 2');RGB = (/193,205,205/)
CASE ('AZURE 3');RGB = (/131,139,139/)
CASE ('BANANA');RGB = (/227,207,87/)
CASE ('BEIGE');RGB = (/245,245,220/)
CASE ('BISQUE');RGB = (/255,228,196/)
CASE ('BISQUE 1');RGB = (/238,213,183/)
CASE ('BISQUE 2');RGB = (/205,183,158/)
CASE ('BISQUE 3');RGB = (/139,125,107/)
CASE ('BLACK');RGB = (/0,0,0/)
CASE ('BLANCHED ALMOND');RGB = (/255,235,205/)
CASE ('BLUE');RGB = (/0,0,255/)
CASE ('BLUE 2');RGB = (/0,0,238/)
CASE ('BLUE 3');RGB = (/0,0,205/)
CASE ('BLUE 4');RGB = (/0,0,139/)
CASE ('BLUE VIOLET');RGB = (/138,43,226/)
CASE ('BRICK');RGB = (/156,102,31/)
CASE ('BROWN');RGB = (/165,42,42/)
CASE ('BROWN 1');RGB = (/255,64,64/)
CASE ('BROWN 2');RGB = (/238,59,59/)
CASE ('BROWN 3');RGB = (/205,51,51/)
CASE ('BROWN 4');RGB = (/139,35,35/)
CASE ('BURLY WOOD');RGB = (/222,184,135/)
CASE ('BURLY WOOD 1');RGB = (/255,211,155/)
CASE ('BURLY WOOD 2');RGB = (/238,197,145/)
CASE ('BURLY WOOD 3');RGB = (/205,170,125/)
CASE ('BURLY WOOD 4');RGB = (/139,115,85/)
CASE ('BURNT ORANGE');RGB = (/204,85,0/)
CASE ('BURNT SIENNA');RGB = (/138,54,15/)
CASE ('BURNT UMBER');RGB = (/138,51,36/)
CASE ('CADET BLUE');RGB = (/95,158,160/)
CASE ('CADET BLUE 1');RGB = (/152,245,255/)
CASE ('CADET BLUE 2');RGB = (/142,229,238/)
CASE ('CADET BLUE 3');RGB = (/122,197,205/)
CASE ('CADET BLUE 4');RGB = (/83,134,139/)
CASE ('CADMIUM ORANGE');RGB = (/255,97,3/)
CASE ('CADMIUM YELLOW');RGB = (/255,153,18/)
CASE ('CARROT');RGB = (/237,145,33/)
CASE ('CHARTREUSE');RGB = (/127,255,0/)
CASE ('CHARTREUSE 1');RGB = (/118,238,0/)
CASE ('CHARTREUSE 2');RGB = (/102,205,0/)
CASE ('CHARTREUSE 3');RGB = (/69,139,0/)
CASE ('CHOCOLATE');RGB = (/210,105,30/)
CASE ('CHOCOLATE 1');RGB = (/255,127,36/)
CASE ('CHOCOLATE 2');RGB = (/238,118,33/)
CASE ('CHOCOLATE 3');RGB = (/205,102,29/)
CASE ('CHOCOLATE 4');RGB = (/139,69,19/)
CASE ('COBALT');RGB = (/61,89,171/)
CASE ('COBALT GREEN');RGB = (/61,145,64/)
CASE ('COLD GREY');RGB = (/128,138,135/)
CASE ('CORAL');RGB = (/255,127,80/)
CASE ('CORAL 1');RGB = (/255,114,86/)
CASE ('CORAL 2');RGB = (/238,106,80/)
CASE ('CORAL 3');RGB = (/205,91,69/)
CASE ('CORAL 4');RGB = (/139,62,47/)
CASE ('CORNFLOWER BLUE');RGB = (/100,149,237/)
CASE ('CORNSILK');RGB = (/255,248,220/)
CASE ('CORNSILK 1');RGB = (/238,232,205/)
CASE ('CORNSILK 2');RGB = (/205,200,177/)
CASE ('CORNSILK 3');RGB = (/139,136,120/)
CASE ('CRIMSON');RGB = (/220,20,60/)
CASE ('CYAN');RGB = (/0,255,255/)
CASE ('CYAN 2');RGB = (/0,238,238/)
CASE ('CYAN 3');RGB = (/0,205,205/)
CASE ('CYAN 4');RGB = (/0,139,139/)
CASE ('DARK GOLDENROD');RGB = (/184,134,11/)
CASE ('DARK GOLDENROD 1');RGB = (/255,185,15/)
CASE ('DARK GOLDENROD 2');RGB = (/238,173,14/)
CASE ('DARK GOLDENROD 3');RGB = (/205,149,12/)
CASE ('DARK GOLDENROD 4');RGB = (/139,101,8/)
CASE ('DARK GRAY');RGB = (/169,169,169/)
CASE ('DARK GREEN');RGB = (/0,100,0/)
CASE ('DARK KHAKI');RGB = (/189,183,107/)
CASE ('DARK OLIVE GREEN');RGB = (/85,107,47/)
CASE ('DARK OLIVE GREEN 1');RGB = (/202,255,112/)
CASE ('DARK OLIVE GREEN 2');RGB = (/188,238,104/)
CASE ('DARK OLIVE GREEN 3');RGB = (/162,205,90/)
CASE ('DARK OLIVE GREEN 4');RGB = (/110,139,61/)
CASE ('DARK ORANGE');RGB = (/255,140,0/)
CASE ('DARK ORANGE 1');RGB = (/255,127,0/)
CASE ('DARK ORANGE 2');RGB = (/238,118,0/)
CASE ('DARK ORANGE 3');RGB = (/205,102,0/)
CASE ('DARK ORANGE 4');RGB = (/139,69,0/)
CASE ('DARK ORCHID');RGB = (/153,50,204/)
CASE ('DARK ORCHID 1');RGB = (/191,62,255/)
CASE ('DARK ORCHID 2');RGB = (/178,58,238/)
CASE ('DARK ORCHID 3');RGB = (/154,50,205/)
CASE ('DARK ORCHID 4');RGB = (/104,34,139/)
CASE ('DARK SALMON');RGB = (/233,150,122/)
CASE ('DARK SEA GREEN');RGB = (/143,188,143/)
CASE ('DARK SEA GREEN 1');RGB = (/193,255,193/)
CASE ('DARK SEA GREEN 2');RGB = (/180,238,180/)
CASE ('DARK SEA GREEN 3');RGB = (/155,205,155/)
CASE ('DARK SEA GREEN 4');RGB = (/105,139,105/)
CASE ('DARK SLATE BLUE');RGB = (/72,61,139/)
CASE ('DARK SLATE GRAY');RGB = (/47,79,79/)
CASE ('DARK SLATE GRAY 1');RGB = (/151,255,255/)
CASE ('DARK SLATE GRAY 2');RGB = (/141,238,238/)
CASE ('DARK SLATE GRAY 3');RGB = (/121,205,205/)
CASE ('DARK SLATE GRAY 4');RGB = (/82,139,139/)
CASE ('DARK TURQUOISE');RGB = (/0,206,209/)
CASE ('DARK VIOLET');RGB = (/148,0,211/)
CASE ('DEEP PINK');RGB = (/255,20,147/)
CASE ('DEEP PINK 1');RGB = (/238,18,137/)
CASE ('DEEP PINK 2');RGB = (/205,16,118/)
CASE ('DEEP PINK 3');RGB = (/139,10,80/)
CASE ('DEEP SKYBLUE');RGB = (/0,191,255/)
CASE ('DEEP SKYBLUE 1');RGB = (/0,178,238/)
CASE ('DEEP SKYBLUE 2');RGB = (/0,154,205/)
CASE ('DEEP SKYBLUE 3');RGB = (/0,104,139/)
CASE ('DIM GRAY');RGB = (/105,105,105/)
CASE ('DODGERBLUE');RGB = (/30,144,255/)
CASE ('DODGERBLUE 1');RGB = (/28,134,238/)
CASE ('DODGERBLUE 2');RGB = (/24,116,205/)
CASE ('DODGERBLUE 3');RGB = (/16,78,139/)
CASE ('EGGSHELL');RGB = (/252,230,201/)
CASE ('EMERALD GREEN');RGB = (/0,201,87/)
CASE ('FIREBRICK');RGB = (/178,34,34/)
CASE ('FIREBRICK 1');RGB = (/255,48,48/)
CASE ('FIREBRICK 2');RGB = (/238,44,44/)
CASE ('FIREBRICK 3');RGB = (/205,38,38/)
CASE ('FIREBRICK 4');RGB = (/139,26,26/)
CASE ('FLESH');RGB = (/255,125,64/)
CASE ('FLORAL WHITE');RGB = (/255,250,240/)
CASE ('FOREST GREEN');RGB = (/34,139,34/)
CASE ('GAINSBORO');RGB = (/220,220,220/)
CASE ('GHOST WHITE');RGB = (/248,248,255/)
CASE ('GOLD');RGB = (/255,215,0/)
CASE ('GOLD 1');RGB = (/238,201,0/)
CASE ('GOLD 2');RGB = (/205,173,0/)
CASE ('GOLD 3');RGB = (/139,117,0/)
CASE ('GOLDENROD');RGB = (/218,165,32/)
CASE ('GOLDENROD 1');RGB = (/255,193,37/)
CASE ('GOLDENROD 2');RGB = (/238,180,34/)
CASE ('GOLDENROD 3');RGB = (/205,155,29/)
CASE ('GOLDENROD 4');RGB = (/139,105,20/)
CASE ('GRAY');RGB = (/128,128,128/)
CASE ('GRAY 1');RGB = (/3,3,3/)
CASE ('GRAY 10');RGB = (/26,26,26/)
CASE ('GRAY 11');RGB = (/28,28,28/)
CASE ('GRAY 12');RGB = (/31,31,31/)
CASE ('GRAY 13');RGB = (/33,33,33/)
CASE ('GRAY 14');RGB = (/36,36,36/)
CASE ('GRAY 15');RGB = (/38,38,38/)
CASE ('GRAY 16');RGB = (/41,41,41/)
CASE ('GRAY 17');RGB = (/43,43,43/)
CASE ('GRAY 18');RGB = (/46,46,46/)
CASE ('GRAY 19');RGB = (/48,48,48/)
CASE ('GRAY 2');RGB = (/5,5,5/)
CASE ('GRAY 20');RGB = (/51,51,51/)
CASE ('GRAY 21');RGB = (/54,54,54/)
CASE ('GRAY 22');RGB = (/56,56,56/)
CASE ('GRAY 23');RGB = (/59,59,59/)
CASE ('GRAY 24');RGB = (/61,61,61/)
CASE ('GRAY 25');RGB = (/64,64,64/)
CASE ('GRAY 26');RGB = (/66,66,66/)
CASE ('GRAY 27');RGB = (/69,69,69/)
CASE ('GRAY 28');RGB = (/71,71,71/)
CASE ('GRAY 29');RGB = (/74,74,74/)
CASE ('GRAY 3');RGB = (/8,8,8/)
CASE ('GRAY 30');RGB = (/77,77,77/)
CASE ('GRAY 31');RGB = (/79,79,79/)
CASE ('GRAY 32');RGB = (/82,82,82/)
CASE ('GRAY 33');RGB = (/84,84,84/)
CASE ('GRAY 34');RGB = (/87,87,87/)
CASE ('GRAY 35');RGB = (/89,89,89/)
CASE ('GRAY 36');RGB = (/92,92,92/)
CASE ('GRAY 37');RGB = (/94,94,94/)
CASE ('GRAY 38');RGB = (/97,97,97/)
CASE ('GRAY 39');RGB = (/99,99,99/)
CASE ('GRAY 4');RGB = (/10,10,10/)
CASE ('GRAY 40');RGB = (/102,102,102/)
CASE ('GRAY 42');RGB = (/107,107,107/)
CASE ('GRAY 43');RGB = (/110,110,110/)
CASE ('GRAY 44');RGB = (/112,112,112/)
CASE ('GRAY 45');RGB = (/115,115,115/)
CASE ('GRAY 46');RGB = (/117,117,117/)
CASE ('GRAY 47');RGB = (/120,120,120/)
CASE ('GRAY 48');RGB = (/122,122,122/)
CASE ('GRAY 49');RGB = (/125,125,125/)
CASE ('GRAY 5');RGB = (/13,13,13/)
CASE ('GRAY 50');RGB = (/127,127,127/)
CASE ('GRAY 51');RGB = (/130,130,130/)
CASE ('GRAY 52');RGB = (/133,133,133/)
CASE ('GRAY 53');RGB = (/135,135,135/)
CASE ('GRAY 54');RGB = (/138,138,138/)
CASE ('GRAY 55');RGB = (/140,140,140/)
CASE ('GRAY 56');RGB = (/143,143,143/)
CASE ('GRAY 57');RGB = (/145,145,145/)
CASE ('GRAY 58');RGB = (/148,148,148/)
CASE ('GRAY 59');RGB = (/150,150,150/)
CASE ('GRAY 6');RGB = (/15,15,15/)
CASE ('GRAY 60');RGB = (/153,153,153/)
CASE ('GRAY 61');RGB = (/156,156,156/)
CASE ('GRAY 62');RGB = (/158,158,158/)
CASE ('GRAY 63');RGB = (/161,161,161/)
CASE ('GRAY 64');RGB = (/163,163,163/)
CASE ('GRAY 65');RGB = (/166,166,166/)
CASE ('GRAY 66');RGB = (/168,168,168/)
CASE ('GRAY 67');RGB = (/171,171,171/)
CASE ('GRAY 68');RGB = (/173,173,173/)
CASE ('GRAY 69');RGB = (/176,176,176/)
CASE ('GRAY 7');RGB = (/18,18,18/)
CASE ('GRAY 70');RGB = (/179,179,179/)
CASE ('GRAY 71');RGB = (/181,181,181/)
CASE ('GRAY 72');RGB = (/184,184,184/)
CASE ('GRAY 73');RGB = (/186,186,186/)
CASE ('GRAY 74');RGB = (/189,189,189/)
CASE ('GRAY 75');RGB = (/191,191,191/)
CASE ('GRAY 76');RGB = (/194,194,194/)
CASE ('GRAY 77');RGB = (/196,196,196/)
CASE ('GRAY 78');RGB = (/199,199,199/)
CASE ('GRAY 79');RGB = (/201,201,201/)
CASE ('GRAY 8');RGB = (/20,20,20/)
CASE ('GRAY 80');RGB = (/204,204,204/)
CASE ('GRAY 81');RGB = (/207,207,207/)
CASE ('GRAY 82');RGB = (/209,209,209/)
CASE ('GRAY 83');RGB = (/212,212,212/)
CASE ('GRAY 84');RGB = (/214,214,214/)
CASE ('GRAY 85');RGB = (/217,217,217/)
CASE ('GRAY 86');RGB = (/219,219,219/)
CASE ('GRAY 87');RGB = (/222,222,222/)
CASE ('GRAY 88');RGB = (/224,224,224/)
CASE ('GRAY 89');RGB = (/227,227,227/)
CASE ('GRAY 9');RGB = (/23,23,23/)
CASE ('GRAY 90');RGB = (/229,229,229/)
CASE ('GRAY 91');RGB = (/232,232,232/)
CASE ('GRAY 92');RGB = (/235,235,235/)
CASE ('GRAY 93');RGB = (/237,237,237/)
CASE ('GRAY 94');RGB = (/240,240,240/)
CASE ('GRAY 95');RGB = (/242,242,242/)
CASE ('GRAY 97');RGB = (/247,247,247/)
CASE ('GRAY 98');RGB = (/250,250,250/)
CASE ('GRAY 99');RGB = (/252,252,252/)
CASE ('GREEN');RGB = (/0,255,0/)
CASE ('GREEN 2');RGB = (/0,238,0/)
CASE ('GREEN 3');RGB = (/0,205,0/)
CASE ('GREEN 4');RGB = (/0,139,0/)
CASE ('GREEN YELLOW');RGB = (/173,255,47/)
CASE ('HONEYDEW');RGB = (/240,255,240/)
CASE ('HONEYDEW 1');RGB = (/224,238,224/)
CASE ('HONEYDEW 2');RGB = (/193,205,193/)
CASE ('HONEYDEW 3');RGB = (/131,139,131/)
CASE ('HOT PINK');RGB = (/255,105,180/)
CASE ('HOT PINK 1');RGB = (/255,110,180/)
CASE ('HOT PINK 2');RGB = (/238,106,167/)
CASE ('HOT PINK 3');RGB = (/205,96,144/)
CASE ('HOT PINK 4');RGB = (/139,58,98/)
CASE ('INDIAN RED');RGB = (/205,92,92/)
CASE ('INDIAN RED 1');RGB = (/255,106,106/)
CASE ('INDIAN RED 2');RGB = (/238,99,99/)
CASE ('INDIAN RED 3');RGB = (/205,85,85/)
CASE ('INDIAN RED 4');RGB = (/139,58,58/)
CASE ('INDIGO');RGB = (/75,0,130/)
CASE ('IVORY');RGB = (/255,255,240/)
CASE ('IVORY 1');RGB = (/238,238,224/)
CASE ('IVORY 2');RGB = (/205,205,193/)
CASE ('IVORY 3');RGB = (/139,139,131/)
CASE ('IVORY BLACK');RGB = (/41,36,33/)
CASE ('KELLY GREEN');RGB = (/0,128,0/)
CASE ('KHAKI');RGB = (/240,230,140/)
CASE ('KHAKI 1');RGB = (/255,246,143/)
CASE ('KHAKI 2');RGB = (/238,230,133/)
CASE ('KHAKI 3');RGB = (/205,198,115/)
CASE ('KHAKI 4');RGB = (/139,134,78/)
CASE ('LAVENDER');RGB = (/230,230,250/)
CASE ('LAVENDER BLUSH');RGB = (/255,240,245/)
CASE ('LAVENDER BLUSH 1');RGB = (/238,224,229/)
CASE ('LAVENDER BLUSH 2');RGB = (/205,193,197/)
CASE ('LAVENDER BLUSH 3');RGB = (/139,131,134/)
CASE ('LAWN GREEN');RGB = (/124,252,0/)
CASE ('LEMON CHIFFON');RGB = (/255,250,205/)
CASE ('LEMON CHIFFON 1');RGB = (/238,233,191/)
CASE ('LEMON CHIFFON 2');RGB = (/205,201,165/)
CASE ('LEMON CHIFFON 3');RGB = (/139,137,112/)
CASE ('LIGHT BLUE');RGB = (/173,216,230/)
CASE ('LIGHT BLUE 1');RGB = (/191,239,255/)
CASE ('LIGHT BLUE 2');RGB = (/178,223,238/)
CASE ('LIGHT BLUE 3');RGB = (/154,192,205/)
CASE ('LIGHT BLUE 4');RGB = (/104,131,139/)
CASE ('LIGHT CORAL');RGB = (/240,128,128/)
CASE ('LIGHT CYAN');RGB = (/224,255,255/)
CASE ('LIGHT CYAN 1');RGB = (/209,238,238/)
CASE ('LIGHT CYAN 2');RGB = (/180,205,205/)
CASE ('LIGHT CYAN 3');RGB = (/122,139,139/)
CASE ('LIGHT GOLDENROD');RGB = (/255,236,139/)
CASE ('LIGHT GOLDENROD 1');RGB = (/238,220,130/)
CASE ('LIGHT GOLDENROD 2');RGB = (/205,190,112/)
CASE ('LIGHT GOLDENROD 3');RGB = (/139,129,76/)
CASE ('LIGHT GOLDENROD YELLOW');RGB = (/250,250,210/)
CASE ('LIGHT GREY');RGB = (/211,211,211/)
CASE ('LIGHT PINK');RGB = (/255,182,193/)
CASE ('LIGHT PINK 1');RGB = (/255,174,185/)
CASE ('LIGHT PINK 2');RGB = (/238,162,173/)
CASE ('LIGHT PINK 3');RGB = (/205,140,149/)
CASE ('LIGHT PINK 4');RGB = (/139,95,101/)
CASE ('LIGHT SALMON');RGB = (/255,160,122/)
CASE ('LIGHT SALMON 1');RGB = (/238,149,114/)
CASE ('LIGHT SALMON 2');RGB = (/205,129,98/)
CASE ('LIGHT SALMON 3');RGB = (/139,87,66/)
CASE ('LIGHT SEA GREEN');RGB = (/32,178,170/)
CASE ('LIGHT SKY BLUE');RGB = (/135,206,250/)
CASE ('LIGHT SKY BLUE 1');RGB = (/176,226,255/)
CASE ('LIGHT SKY BLUE 2');RGB = (/164,211,238/)
CASE ('LIGHT SKY BLUE 3');RGB = (/141,182,205/)
CASE ('LIGHT SKY BLUE 4');RGB = (/96,123,139/)
CASE ('LIGHT SLATE BLUE');RGB = (/132,112,255/)
CASE ('LIGHT SLATE GRAY');RGB = (/119,136,153/)
CASE ('LIGHT STEEL BLUE');RGB = (/176,196,222/)
CASE ('LIGHT STEEL BLUE 1');RGB = (/202,225,255/)
CASE ('LIGHT STEEL BLUE 2');RGB = (/188,210,238/)
CASE ('LIGHT STEEL BLUE 3');RGB = (/162,181,205/)
CASE ('LIGHT STEEL BLUE 4');RGB = (/110,123,139/)
CASE ('LIGHT YELLOW 1');RGB = (/255,255,224/)
CASE ('LIGHT YELLOW 2');RGB = (/238,238,209/)
CASE ('LIGHT YELLOW 3');RGB = (/205,205,180/)
CASE ('LIGHT YELLOW 4');RGB = (/139,139,122/)
CASE ('LIME GREEN');RGB = (/50,205,50/)
CASE ('LINEN');RGB = (/250,240,230/)
CASE ('MAGENTA');RGB = (/255,0,255/)
CASE ('MAGENTA 2');RGB = (/238,0,238/)
CASE ('MAGENTA 3');RGB = (/205,0,205/)
CASE ('MAGENTA 4');RGB = (/139,0,139/)
CASE ('MANGANESE BLUE');RGB = (/3,168,158/)
CASE ('MAROON');RGB = (/128,0,0/)
CASE ('MAROON 1');RGB = (/255,52,179/)
CASE ('MAROON 2');RGB = (/238,48,167/)
CASE ('MAROON 3');RGB = (/205,41,144/)
CASE ('MAROON 4');RGB = (/139,28,98/)
CASE ('MEDIUM ORCHID');RGB = (/186,85,211/)
CASE ('MEDIUM ORCHID 1');RGB = (/224,102,255/)
CASE ('MEDIUM ORCHID 2');RGB = (/209,95,238/)
CASE ('MEDIUM ORCHID 3');RGB = (/180,82,205/)
CASE ('MEDIUM ORCHID 4');RGB = (/122,55,139/)
CASE ('MEDIUM PURPLE');RGB = (/147,112,219/)
CASE ('MEDIUM PURPLE 1');RGB = (/171,130,255/)
CASE ('MEDIUM PURPLE 2');RGB = (/159,121,238/)
CASE ('MEDIUM PURPLE 3');RGB = (/137,104,205/)
CASE ('MEDIUM PURPLE 4');RGB = (/93,71,139/)
CASE ('MEDIUM SEA GREEN');RGB = (/60,179,113/)
CASE ('MEDIUM SLATE BLUE');RGB = (/123,104,238/)
CASE ('MEDIUM SPRING GREEN');RGB = (/0,250,154/)
CASE ('MEDIUM TURQUOISE');RGB = (/72,209,204/)
CASE ('MEDIUM VIOLET RED');RGB = (/199,21,133/)
CASE ('MELON');RGB = (/227,168,105/)
CASE ('MIDNIGHT BLUE');RGB = (/25,25,112/)
CASE ('MINT');RGB = (/189,252,201/)
CASE ('MINT CREAM');RGB = (/245,255,250/)
CASE ('MISTY ROSE');RGB = (/255,228,225/)
CASE ('MISTY ROSE 1');RGB = (/238,213,210/)
CASE ('MISTY ROSE 2');RGB = (/205,183,181/)
CASE ('MISTY ROSE 3');RGB = (/139,125,123/)
CASE ('MOCCASIN');RGB = (/255,228,181/)
CASE ('NAVAJO WHITE');RGB = (/255,222,173/)
CASE ('NAVAJO WHITE 1');RGB = (/238,207,161/)
CASE ('NAVAJO WHITE 2');RGB = (/205,179,139/)
CASE ('NAVAJO WHITE 3');RGB = (/139,121,94/)
CASE ('NAVY');RGB = (/0,0,128/)
CASE ('OLD LACE');RGB = (/253,245,230/)
CASE ('OLIVE');RGB = (/128,128,0/)
CASE ('OLIVE DRAB');RGB = (/192,255,62/)
CASE ('OLIVE DRAB 1');RGB = (/179,238,58/)
CASE ('OLIVE DRAB 2');RGB = (/154,205,50/)
CASE ('OLIVE DRAB 3');RGB = (/105,139,34/)
CASE ('ORANGE');RGB = (/255,128,0/)
CASE ('ORANGE 1');RGB = (/255,165,0/)
CASE ('ORANGE 2');RGB = (/238,154,0/)
CASE ('ORANGE 3');RGB = (/205,133,0/)
CASE ('ORANGE 4');RGB = (/139,90,0/)
CASE ('ORANGE RED');RGB = (/255,69,0/)
CASE ('ORANGE RED 1');RGB = (/238,64,0/)
CASE ('ORANGE RED 2');RGB = (/205,55,0/)
CASE ('ORANGE RED 3');RGB = (/139,37,0/)
CASE ('ORCHID');RGB = (/218,112,214/)
CASE ('ORCHID 1');RGB = (/255,131,250/)
CASE ('ORCHID 2');RGB = (/238,122,233/)
CASE ('ORCHID 3');RGB = (/205,105,201/)
CASE ('ORCHID 4');RGB = (/139,71,137/)
CASE ('PALE GOLDENROD');RGB = (/238,232,170/)
CASE ('PALE GREEN');RGB = (/152,251,152/)
CASE ('PALE GREEN 1');RGB = (/154,255,154/)
CASE ('PALE GREEN 2');RGB = (/144,238,144/)
CASE ('PALE GREEN 3');RGB = (/124,205,124/)
CASE ('PALE GREEN 4');RGB = (/84,139,84/)
CASE ('PALE TURQUOISE');RGB = (/187,255,255/)
CASE ('PALE TURQUOISE 1');RGB = (/174,238,238/)
CASE ('PALE TURQUOISE 2');RGB = (/150,205,205/)
CASE ('PALE TURQUOISE 3');RGB = (/102,139,139/)
CASE ('PALE VIOLET RED');RGB = (/219,112,147/)
CASE ('PALE VIOLET RED 1');RGB = (/255,130,171/)
CASE ('PALE VIOLET RED 2');RGB = (/238,121,159/)
CASE ('PALE VIOLET RED 3');RGB = (/205,104,137/)
CASE ('PALE VIOLET RED 4');RGB = (/139,71,93/)
CASE ('PAPAYA WHIP');RGB = (/255,239,213/)
CASE ('PEACH PUFF');RGB = (/255,218,185/)
CASE ('PEACH PUFF 1');RGB = (/238,203,173/)
CASE ('PEACH PUFF 2');RGB = (/205,175,149/)
CASE ('PEACH PUFF 3');RGB = (/139,119,101/)
CASE ('PEACOCK');RGB = (/51,161,201/)
CASE ('PINK');RGB = (/255,192,203/)
CASE ('PINK 1');RGB = (/255,181,197/)
CASE ('PINK 2');RGB = (/238,169,184/)
CASE ('PINK 3');RGB = (/205,145,158/)
CASE ('PINK 4');RGB = (/139,99,108/)
CASE ('PLUM');RGB = (/221,160,221/)
CASE ('PLUM 1');RGB = (/255,187,255/)
CASE ('PLUM 2');RGB = (/238,174,238/)
CASE ('PLUM 3');RGB = (/205,150,205/)
CASE ('PLUM 4');RGB = (/139,102,139/)
CASE ('POWDER BLUE');RGB = (/176,224,230/)
CASE ('PURPLE');RGB = (/128,0,128/)
CASE ('PURPLE 1');RGB = (/155,48,255/)
CASE ('PURPLE 2');RGB = (/145,44,238/)
CASE ('PURPLE 3');RGB = (/125,38,205/)
CASE ('PURPLE 4');RGB = (/85,26,139/)
CASE ('RAINBOW')
   DO IC=1,3
      CALL RANDOM_NUMBER(RAN_NUM)
      RGB(IC) = INT(RAN_NUM*255._EB)
   ENDDO
CASE ('RASPBERRY');RGB = (/135,38,87/)
CASE ('RAW SIENNA');RGB = (/199,97,20/)
CASE ('RED');RGB = (/255,0,0/)
CASE ('RED 1');RGB = (/238,0,0/)
CASE ('RED 2');RGB = (/205,0,0/)
CASE ('RED 3');RGB = (/139,0,0/)
CASE ('ROSY BROWN');RGB = (/188,143,143/)
CASE ('ROSY BROWN 1');RGB = (/255,193,193/)
CASE ('ROSY BROWN 2');RGB = (/238,180,180/)
CASE ('ROSY BROWN 3');RGB = (/205,155,155/)
CASE ('ROSY BROWN 4');RGB = (/139,105,105/)
CASE ('ROYAL BLUE');RGB = (/65,105,225/)
CASE ('ROYAL BLUE 1');RGB = (/72,118,255/)
CASE ('ROYAL BLUE 2');RGB = (/67,110,238/)
CASE ('ROYAL BLUE 3');RGB = (/58,95,205/)
CASE ('ROYAL BLUE 4');RGB = (/39,64,139/)
CASE ('SALMON');RGB = (/250,128,114/)
CASE ('SALMON 1');RGB = (/255,140,105/)
CASE ('SALMON 2');RGB = (/238,130,98/)
CASE ('SALMON 3');RGB = (/205,112,84/)
CASE ('SALMON 4');RGB = (/139,76,57/)
CASE ('SANDY BROWN');RGB = (/244,164,96/)
CASE ('SAP GREEN');RGB = (/48,128,20/)
CASE ('SEA GREEN');RGB = (/84,255,159/)
CASE ('SEA GREEN 1');RGB = (/78,238,148/)
CASE ('SEA GREEN 2');RGB = (/67,205,128/)
CASE ('SEA GREEN 3');RGB = (/46,139,87/)
CASE ('SEASHELL');RGB = (/255,245,238/)
CASE ('SEASHELL 1');RGB = (/238,229,222/)
CASE ('SEASHELL 2');RGB = (/205,197,191/)
CASE ('SEASHELL 3');RGB = (/139,134,130/)
CASE ('SEPIA');RGB = (/94,38,18/)
CASE ('SIENNA');RGB = (/160,82,45/)
CASE ('SIENNA 1');RGB = (/255,130,71/)
CASE ('SIENNA 2');RGB = (/238,121,66/)
CASE ('SIENNA 3');RGB = (/205,104,57/)
CASE ('SIENNA 4');RGB = (/139,71,38/)
CASE ('SILVER');RGB = (/192,192,192/)
CASE ('SKY BLUE');RGB = (/135,206,235/)
CASE ('SKY BLUE 1');RGB = (/135,206,255/)
CASE ('SKY BLUE 2');RGB = (/126,192,238/)
CASE ('SKY BLUE 3');RGB = (/108,166,205/)
CASE ('SKY BLUE 4');RGB = (/74,112,139/)
CASE ('SLATE BLUE');RGB = (/106,90,205/)
CASE ('SLATE BLUE 1');RGB = (/131,111,255/)
CASE ('SLATE BLUE 2');RGB = (/122,103,238/)
CASE ('SLATE BLUE 3');RGB = (/105,89,205/)
CASE ('SLATE BLUE 4');RGB = (/71,60,139/)
CASE ('SLATE GRAY');RGB = (/112,128,144/)
CASE ('SLATE GRAY 1');RGB = (/198,226,255/)
CASE ('SLATE GRAY 2');RGB = (/185,211,238/)
CASE ('SLATE GRAY 3');RGB = (/159,182,205/)
CASE ('SLATE GRAY 4');RGB = (/108,123,139/)
CASE ('SNOW');RGB = (/255,250,250/)
CASE ('SNOW 1');RGB = (/238,233,233/)
CASE ('SNOW 2');RGB = (/205,201,201/)
CASE ('SNOW 3');RGB = (/139,137,137/)
CASE ('SPRING GREEN');RGB = (/0,255,127/)
CASE ('SPRING GREEN 1');RGB = (/0,238,118/)
CASE ('SPRING GREEN 2');RGB = (/0,205,102/)
CASE ('SPRING GREEN 3');RGB = (/0,139,69/)
CASE ('STEEL BLUE');RGB = (/70,130,180/)
CASE ('STEEL BLUE 1');RGB = (/99,184,255/)
CASE ('STEEL BLUE 2');RGB = (/92,172,238/)
CASE ('STEEL BLUE 3');RGB = (/79,148,205/)
CASE ('STEEL BLUE 4');RGB = (/54,100,139/)
CASE ('TAN');RGB = (/210,180,140/)
CASE ('TAN 1');RGB = (/255,165,79/)
CASE ('TAN 2');RGB = (/238,154,73/)
CASE ('TAN 3');RGB = (/205,133,63/)
CASE ('TAN 4');RGB = (/139,90,43/)
CASE ('TEAL');RGB = (/0,128,128/)
CASE ('THISTLE');RGB = (/216,191,216/)
CASE ('THISTLE 1');RGB = (/255,225,255/)
CASE ('THISTLE 2');RGB = (/238,210,238/)
CASE ('THISTLE 3');RGB = (/205,181,205/)
CASE ('THISTLE 4');RGB = (/139,123,139/)
CASE ('TOMATO');RGB = (/255,99,71/)
CASE ('TOMATO 1');RGB = (/238,92,66/)
CASE ('TOMATO 2');RGB = (/205,79,57/)
CASE ('TOMATO 3');RGB = (/139,54,38/)
CASE ('TURQUOISE');RGB = (/64,224,208/)
CASE ('TURQUOISE 1');RGB = (/0,245,255/)
CASE ('TURQUOISE 2');RGB = (/0,229,238/)
CASE ('TURQUOISE 3');RGB = (/0,197,205/)
CASE ('TURQUOISE 4');RGB = (/0,134,139/)
CASE ('TURQUOISE BLUE');RGB = (/0,199,140/)
CASE ('VIOLET');RGB = (/238,130,238/)
CASE ('VIOLET RED');RGB = (/208,32,144/)
CASE ('VIOLET RED 1');RGB = (/255,62,150/)
CASE ('VIOLET RED 2');RGB = (/238,58,140/)
CASE ('VIOLET RED 3');RGB = (/205,50,120/)
CASE ('VIOLET RED 4');RGB = (/139,34,82/)
CASE ('WARM GREY');RGB = (/128,128,105/)
CASE ('WHEAT');RGB = (/245,222,179/)
CASE ('WHEAT 1');RGB = (/255,231,186/)
CASE ('WHEAT 2');RGB = (/238,216,174/)
CASE ('WHEAT 3');RGB = (/205,186,150/)
CASE ('WHEAT 4');RGB = (/139,126,102/)
CASE ('WHITE');RGB = (/255,255,255/)
CASE ('WHITE SMOKE');RGB = (/245,245,245/)
CASE ('YELLOW');RGB = (/255,255,0/)
CASE ('YELLOW 1');RGB = (/238,238,0/)
CASE ('YELLOW 2');RGB = (/205,205,0/)
CASE ('YELLOW 3');RGB = (/139,139,0/)

CASE DEFAULT
   WRITE(MESSAGE,'(A,A,A)') "ERROR: The COLOR, ", TRIM(COLOR),", is not a defined color"
   CALL SHUTDOWN(MESSAGE)
END SELECT

END SUBROUTINE COLOR2RGB


END MODULE OUTPUT_DATA


MODULE PROPERTY_DATA
USE PRECISION_PARAMETERS
IMPLICIT NONE

TYPE ELEMENT_TYPE
   CHARACTER(3):: ABBREVIATION
   CHARACTER(20):: NAME
   REAL(EB) :: MASS
END TYPE ELEMENT_TYPE

TYPE(ELEMENT_TYPE):: ELEMENT(118)

CONTAINS

SUBROUTINE JANAF_TABLE (I_TMP,CP,H,SPEC_ID,RCON,FUEL,G_F)

! CP data in this subroutine is taken from 4th Edition of the NIST-JANAF Thermochemical Tables.
! The tabulated data in the tables have been curve fit.
! For gas species that result from liquid evaporation, H is set at the 0 K reference temperature to obtain the correct H_V
! at the H_V reference temperature for that liquid.
! For each species CP is first computed in kJ/mol/K and then converted to J/kg/K.

USE GLOBAL_CONSTANTS, ONLY: GAMMA,Y_O2_INFTY,Y_CO2_INFTY,CONSTANT_SPECIFIC_HEAT_RATIO
CHARACTER(LABEL_LENGTH),INTENT(IN) ::SPEC_ID
INTEGER,INTENT(IN) :: I_TMP
REAL(EB),INTENT(IN) :: RCON
REAL(EB),INTENT(OUT) :: CP,H,G_F
LOGICAL,INTENT(OUT) :: FUEL
REAL(EB) :: CP2,CP3,TE
CHARACTER(LABEL_LENGTH) :: SPEC_ID_USE

IF (CONSTANT_SPECIFIC_HEAT_RATIO) THEN
   SPEC_ID_USE = 'XXX' ! Force the assumption of constant gamma (CP/CV) to get CP.
ELSE
   SPEC_ID_USE = SPEC_ID
ENDIF

TE = REAL(I_TMP,EB)
FUEL = .FALSE.
G_F = 0._EB !kJ/mol
SELECT CASE (SPEC_ID_USE)
   CASE DEFAULT
      CP = RCON*GAMMA/(GAMMA-1._EB) !J/kg/K
      H = 0._EB !J/kg
   CASE('ACETONE') !C3H6O NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -227780.2525_EB*TE**(-2)+4215.28001_EB/TE-24.15785316_EB+0.0990748332_EB*TE-0.0001084940903_EB*TE**2+&
              0.0000000658335596_EB*TE**3-1.676046146E-11_EB*TE**4
      ELSE
         CP = 5001601.92_EB*TE**(-2)-21701.55542_EB/TE+39.6449399_EB-0.00417994505_EB*TE+0.000000796242953_EB*TE**2 &
             -8.12255805E-11_EB*TE**3+3.42878096E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 58.07914_EB !J/kg/K
      H = -4057619.45195132_EB !J/kg
      FUEL = .TRUE.
   CASE('ACETYLENE') !C2H2 NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 159811.2089_EB*TE**(-2)-2216.644118_EB/TE+12.65707813_EB-0.00797965108_EB*TE+0.00000805499275_EB*TE**2 &
            -0.000000002433307673_EB*TE**3-7.52923318E-14_EB*TE**4
      ELSE
         CP = 1713847.41_EB*TE**(-2)-5929.10666_EB/TE+12.36127943_EB+0.0001314186993_EB*TE-0.0000001362764431_EB*TE**2 &
            -8.12255805E-11_EB*TE**3-1.302066204E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 26.03728_EB !J/kg/K
      H = 8340866.44828205_EB !J/kg
      G_F = 8.01693E-07_EB*TE**2 - 5.53979E-02_EB*TE + 2.25100E+02_EB !kJ/mol
      FUEL = .TRUE.
   CASE('ACROLEIN') !C3H4O NIST Webbook
      IF (TE<50._EB) THEN
         CP = 627.6837986_EB + TE * 0.000659594_EB !J/kg/K
      ELSE
         TE = MIN(TE,1500._EB)
         CP = 332.3828_EB-2602.398_EB/TE+0.6547594_EB*TE-0.0005857_EB*TE**2+0.0000002863821_EB*TE**3 &
              -0.00000000005696995_EB*TE**4-70.66684_EB*LOG(TE) !J/mol/K
         CP = CP / 56.06326_EB * 1000._EB !J/kg/K
      ENDIF
      H = -5125986.652_EB !J/kg
   CASE('LJ AIR') ! NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 22103.71497_EB*TE**(-2)-381.846182_EB/TE+6.08273836_EB-0.00853091441_EB*TE+0.00001384646189_EB*TE**2 &
            -0.00000000962579362_EB*TE**3+2.519705809E-12_EB*TE**4
         CP2 = -34255.6342_EB*TE**(-2)+484.700097_EB/TE+1.119010961_EB+0.00429388924_EB*TE-0.000000683630052_EB*TE**2 &
            -0.0000000020233727_EB*TE**3+1.039040018E-12_EB*TE**4
         CP3 = 49436.5054_EB*TE**(-2)-626.411601_EB/TE+5.30172524_EB+0.002503813816_EB*TE-0.0000002127308728_EB*TE**2 &
            -0.000000000768998878_EB*TE**3+2.849677801E-13_EB*TE**4
      ELSE
         CP = 587712.406_EB*TE**(-2)-2239.249073_EB/TE+6.06694922_EB-0.00061396855_EB*TE+0.0000001491806679_EB*TE**2 &
            -1.923105485E-11_EB*TE**3+1.061954386E-15_EB*TE**4
         CP2 = -1037939.022_EB*TE**(-2)+2344.830282_EB/TE+1.819732036_EB+0.001267847582_EB*TE-0.0000002188067988_EB*TE**2+&
            2.053719572E-11_EB*TE**3-8.19346705E-16_EB*TE**4
         CP3 = 117696.2419_EB*TE**(-2)-1788.791477_EB/TE+8.29152319_EB-0.0000922315678_EB*TE+0.00000000486367688_EB*TE**2 &
            -1.891053312E-12_EB*TE**3+6.33003659E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 28.0134_EB !J/kg/K
      CP2 = CP2 * 8314.472_EB / 31.9988_EB !J/kg/K
      CP3 = CP3 * 8314.472_EB / 44.0095_EB !J/kg/K
      H = (1._EB-Y_O2_INFTY-Y_CO2_INFTY)*(-309806.566683287_EB)+&
         Y_O2_INFTY*(-271678.662691491_EB)+ &
         Y_CO2_INFTY*(-9166081.98127305_EB) !J/kg
      CP = (1._EB-Y_O2_INFTY-Y_CO2_INFTY)*CP+Y_O2_INFTY*CP2+Y_CO2_INFTY*CP3 !J/kg/K
   CASE('AMMONIA') ! NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -76812.2615_EB*TE**(-2)+1270.951578_EB/TE-3.89322913_EB+0.02145988418_EB*TE-0.00002183766703_EB*TE**2+ &
            0.00000001317385706_EB*TE**3-3.33232206E-12_EB*TE**4
      ELSE
         CP = 2452389.535_EB*TE**(-2)-8040.89424_EB/TE+12.71346201_EB-0.000398018658_EB*TE+0.0000000355250275_EB*TE**2+ &
            2.53092357E-12_EB*TE**3-3.32270053E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 17.03052_EB !J/kg/K
      H = -3293221.051_EB !J/kg
      G_F = 7.85447E-18_EB*TE**6 - 0.0000000000000546054_EB*TE**5 + 0.000000000151562_EB*TE**4 - 0.000000216831_EB*TE**3 &
          + 0.000173512_EB*TE**2 + 0.0394498_EB*TE - 39.0864_EB
   CASE('ARGON') ! Ar (JANAF)
      CP = 20.786_EB / 0.03948_EB !J/kg/K
      H = -155135.3234_EB !J/kg
   CASE('BENZENE')  !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -167734.0902_EB*TE**(-2)+4404.50004_EB/TE-37.1737791_EB+0.1640509559_EB*TE-0.0002020812374_EB*TE**2+&
            0.0000001307915264_EB*TE**3-0.000000000034442841_EB*TE**4
      ELSE
         CP = 4538575.72_EB*TE**(-2)-22605.02547_EB/TE+46.940073_EB-0.00420667683_EB*TE+0.000000790799433_EB*TE**2 &
            -0.000000000079683021_EB*TE**3+3.32821208E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 78.11184_EB !J/kg/K
      H = 841261.195179757_EB !J/kg
      FUEL = .TRUE.
   CASE('BUTANE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -317587.254_EB*TE**(-2)+6176.33182_EB/TE-38.9156212_EB+0.1584654284_EB*TE-0.0001860050159_EB*TE**2+&
            0.0000001199676349_EB*TE**3-3.20167055E-11_EB*TE**4
      ELSE
         CP = 7682322.45_EB*TE**(-2)-32560.5151_EB/TE+57.3673275_EB-0.00619791681_EB*TE+0.000001180186048_EB*TE**2 &
            -1.221893698E-10_EB*TE**3+5.25063525E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 58.1222_EB !J/kg/K
      H = -2573933.42528525_EB !J/kg
      FUEL = .TRUE.
   CASE('CARBON') !NIST webbook
      IF (TE<100._EB)  THEN
         CP = 21.638_EB-0.00367_EB*TE
      ELSEIF (TE>300._EB) THEN
         CP = -7.67540E-22_EB*TE**6 + 1.84522E-17_EB*TE**5 - 1.66600E-13_EB*TE**4 + 6.70547E-10_EB*TE**3 - &
              1.04838E-06_EB*TE**2 + 6.03500E-04_EB*TE + 2.07072E+01_EB
      ELSE
         CP = 6.57321E-10_EB*TE**4 - 6.32390E-07_EB*TE**3 + 2.30154E-04_EB*TE**2 - 3.83086E-02_EB*TE + 2.33670E+01_EB !J/mol/K
      ENDIF
      CP = CP / 12.0107_EB * 1000._EB !J/kg/K
      G_F = -1.25809E-20_EB*TE**6 + 2.64375E-16_EB*TE**5 - 2.21974E-12_EB*TE**4 + 9.51092E-09_EB*TE**3 - 2.22359E-05_EB*TE**2 + &
            2.28487E-02_EB*TE + 7.11486E+02_EB ! kJ/mol
   CASE('CARBON DIOXIDE') !CO2 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 49436.5054_EB*TE**(-2)-626.411601_EB/TE+5.30172524_EB+0.002503813816_EB*TE-0.0000002127308728_EB*TE**2 &
            -0.000000000768998878_EB*TE**3+2.849677801E-13_EB*TE**4
      ELSE
         CP = 117696.2419_EB*TE**(-2)-1788.791477_EB/TE+8.29152319_EB-0.0000922315678_EB*TE+0.00000000486367688_EB*TE**2 &
            -1.891053312E-12_EB*TE**3+6.33003659E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 44.0095_EB !J/kg/K
      H = -9166081.98127305_EB !J/kg
   CASE('CARBON MONOXIDE') !CO (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 14890.45326_EB*TE**(-2)-292.2285939_EB/TE+5.72452717_EB-0.00817623503_EB*TE+0.00001456903469_EB*TE**2 &
            -0.00000001087746302_EB*TE**3+3.027941827E-12_EB*TE**4
      ELSE
         CP = 461919.725_EB*TE**(-2)-1944.704863_EB/TE+5.91671418_EB-0.000566428283_EB*TE+0.000000139881454_EB*TE**2 &
            -1.787680361E-11_EB*TE**3+9.62093557E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 28.0101_EB !J/kg/K
      H = -4256149.77464245_EB !J/kg
   CASE('CHLORINE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 34628.1517_EB*TE**(-2)-554.712652_EB/TE+6.20758937_EB-0.002989632078_EB*TE+0.00000317302729_EB*TE**2 &
            -0.000000001793629562_EB*TE**3+4.26004359E-13_EB*TE**4
      ELSE
         CP = 6092569.42_EB*TE**(-2)-19496.27662_EB/TE+28.54535795_EB-0.01449968764_EB*TE+0.00000446389077_EB*TE**2 &
            -0.000000000635852586_EB*TE**3+3.32736029E-14_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 70.906_EB !J/kg/K
      H = -135040.707108809_EB !J/kg
   CASE('DODECANE') !C12H26
      ! Vargaftik, N. B.    MOSKVA: IZDATELSTVO NAUKA 1972 , p. 284 (1972)
      ! DICTIONARY OF THERMOPHYSICAL PROPERTIES OF GASES AND LIQUIDS
      ! from InfoTherm, Fitz Chemie Berlin www.fitz-chemie.de/infotherm
      TE=MIN(1500._EB,MAX(TE,288._EB))
      CP=-7.859196_EB+6.714808E-02_EB*TE**0.25_EB-7.954283e-28_EB*TE**8+1.622011_EB*LOG(TE)
      CP=CP*1000._EB
      H=-1580710.54517503_EB
      FUEL = .TRUE.
   CASE('ETHANE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -186204.4161_EB*TE**(-2)+3406.19186_EB/TE-19.51705092_EB+0.0756583559_EB*TE-0.0000820417322_EB*TE**2+&
            0.000000050611358_EB*TE**3-1.319281992E-11_EB*TE**4
      ELSE
         CP = 5025782.13_EB*TE**(-2)-20330.22397_EB/TE+33.2255293_EB-0.00383670341_EB*TE+0.000000723840586_EB*TE**2 &
            -0.000000000073191825_EB*TE**3+3.065468699E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 30.06904_EB !J/kg/K
      H = -3223974.05290646_EB !J/kg
      FUEL = .TRUE.
   CASE('ETHANOL') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -234279.1392_EB*TE**(-2)+4479.18055_EB/TE-27.44817302_EB+0.1088679162_EB*TE-0.0001305309334_EB*TE**2 &
            +0.000000084373464_EB*TE**3-2.234559017E-11_EB*TE**4
      ELSE
         CP = 4694817.65_EB*TE**(-2)-19297.98213_EB/TE+34.4758404_EB-0.00323616598_EB*TE+0.000000578494772_EB*TE**2 &
            -5.56460027E-11_EB*TE**3+2.2262264E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 46.06844_EB !J/kg/K
      H = -5451137.78731021_EB !J/kg
   CASE('ETHYLENE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -116360.5836_EB*TE**(-2)+2554.85151_EB/TE-16.09746428_EB+0.0662577932_EB*TE-0.0000788508186_EB*TE**2+&
            0.0000000512522482_EB*TE**3-1.370340031E-11_EB*TE**4
      ELSE
         CP = 3408763.67_EB*TE**(-2)-13748.47903_EB/TE+23.65898074_EB-0.002423804419_EB*TE+0.000000443139566_EB*TE**2 &
            -4.35268339E-11_EB*TE**3+1.775410633E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 28.05316_EB !J/kg/K
      H = 1483808.171_EB !J/kg
      G_F = -3.80102E-10_EB*TE**3 + 4.53457E-06_EB*TE**2 + 6.83843E-02_EB*TE + 4.88117E+01_EB !kJ/mol
      FUEL = .TRUE.
   CASE('FORMALDEHYDE') !H2CO NASA/TP-2002-211556
      IF (TE < 200._EB) THEN
         CP = 33.014_EB + 0.00244_EB*TE
      ELSE
         CP = -890.5404_EB - 2.344985E6_EB/TE**2 + 47594.12_EB/TE - 0.1078016_EB*TE + 0.00001930888_EB*TE**2 - &
               2.403672E-9_EB*TE**3 + 1.653685E-13_EB*TE**4 - 4.553202E-18_EB*TE**5 + 144.4767_EB*LOG(TE) !J/mol/K
      ENDIF
      CP = CP / 30.02598_EB * 1000._EB !J/kg/K
      H = -4193689.326_EB !J/kg
      G_F = -6.30402E-17_EB*TE**5 + 1.08458E-12_EB*TE**4 - 6.92692E-09_EB*TE**3 + 2.08591E-05_EB*TE**2 + &
            1.07248E-02_EB*TE - 1.14184E+02_EB !kJ/mol
   CASE('HYDROGEN') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 40783.2321_EB*TE**(-2)-800.918604_EB/TE+8.21470201_EB-0.01269714457_EB*TE+0.00001753605076_EB*TE**2 &
            -0.0000000120286027_EB*TE**3+3.36809349E-12_EB*TE**4
      ELSE
         CP = 560812.801_EB*TE**(-2)-837.150474_EB/TE+2.975364532_EB+0.001252249124_EB*TE-0.000000374071619_EB*TE**2+&
            0.000000000059366252_EB*TE**3-3.6069941E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 2.01588_EB !J/kg/K
      H = -4099577.77248286_EB !J/kg
      G_F = 1.39298E-13_EB*TE**4 - 1.90467E-09_EB*TE**3 + 9.67278E-06_EB*TE**2 + 2.00936E-02_EB*TE - 1.15955E+02_EB !kJ/mol
   CASE('HYDROGEN ATOM') !H (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,1000._EB))
      CP = 60.7877425_EB*TE**(-2)-0.1819354417_EB/TE+2.500211817_EB-0.0000001226512864_EB*TE+3.73287633E-11_EB*TE**2 &
         -5.68774456E-15_EB*TE**3+3.410210197E-19_EB*TE**4
      CP = CP * 8314.472_EB / 1.00794_EB !J/kg/K
      H = 210131280.137264_EB !J/kg
      G_F = -6.58297E-14_EB*TE**4 + 1.01425E-09_EB*TE**3 - 5.75794E-06_EB*TE**2 - 4.72957E-02_EB*TE + 2.17559E+02_EB !kJ/mol JANAF
   CASE('HYDROGEN BROMIDE') !HBr (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 25272.22498_EB*TE**(-2)-406.511027_EB/TE+6.04311661_EB-0.00771788287_EB*TE+0.00001149123213_EB*TE**2 &
            -0.00000000729363328_EB*TE**3+1.747406491E-12_EB*TE**4
      ELSE
         CP = 1170033.949_EB*TE**(-2)-3786.52101_EB/TE+7.50314805_EB-0.001284963943_EB*TE+0.000000320625719_EB*TE**2 &
            -3.44492516E-11_EB*TE**3+1.126758417E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 80.91194_EB !J/kg/K
      H = -555835.90129522_EB !J/kg
      IF (TE<350._EB) THEN
         G_F = 3.41787E-07_EB*TE**3 - 1.10039E-04_EB*TE**2 - 8.07048E-02_EB*TE - 2.86316E+01_EB !kJ/mol
      ELSE
         G_F = -2.05465E-11_EB*TE**3 + 4.31110E-07_EB*TE**2 - 7.78287E-03_EB*TE - 5.32586E+01_EB
      ENDIF
   CASE('HYDROGEN CHLORIDE') !HCl (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 20625.88287_EB*TE**(-2)-309.3368855_EB/TE+5.27541885_EB-0.00482887422_EB*TE+0.0000061957946_EB*TE**2 &
            -0.000000003040023782_EB*TE**3+4.91679003E-13_EB*TE**4
      ELSE
         CP = 915774.951_EB*TE**(-2)-2770.550211_EB/TE+5.97353979_EB-0.000362981006_EB*TE+0.0000000473552919_EB*TE**2+&
            2.810262054E-12_EB*TE**3-6.65610422E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 36.46094_EB !J/kg/K
      H = -2769907.76626335_EB !J/kg
      G_F = -5.52728E-11_EB*TE**3 + 8.18811E-07_EB*TE**2 - 8.36278E-03_EB*TE - 9.28957E+01_EB !kJ/mol
   CASE('HYDROGEN CYANIDE') !HCN (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 90982.8693_EB*TE**(-2)-1238.657512_EB/TE+8.72130787_EB-0.00652824294_EB*TE+0.00000887270083_EB*TE**2 &
            -0.00000000480888667_EB*TE**3+9.3178985E-13_EB*TE**4
      ELSE
         CP = 1236889.278_EB*TE**(-2)-4446.73241_EB/TE+9.73887485_EB-0.000585518264_EB*TE+0.000000107279144_EB*TE**2 &
            -1.013313244E-11_EB*TE**3+3.34824798E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 27.02534_EB !J/kg/K
      H = 4566835.58065113_EB !J/kg
      G_F = -5.64249E-11_EB*TE**3 + 1.06118E-06_EB*TE**2 - 3.42625E-02_EB*TE + 1.34844E+02_EB !kJ/mol
   CASE('HYDROGEN FLUORIDE') ! HF (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -3192.09897_EB*TE**(-2)+59.8680772_EB/TE+3.055113902_EB+0.001684673783_EB*TE-0.00000328739483_EB*TE**2+&
            0.000000003095923617_EB*TE**3-9.76469161E-13_EB*TE**4
      ELSE
         CP = 725708.904_EB*TE**(-2)-1484.797741_EB/TE+3.85552747_EB+0.000713898985_EB*TE-0.0000002106757333_EB*TE**2+&
            3.050092453E-11_EB*TE**3-1.639495583E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 20.0063432_EB !J/kg/K
      H = -14094776.7508171_EB !J/kg
      G_F = -3.25864E-21_EB*TE**6 + 6.60032E-17_EB*TE**5 - 5.40666E-13_EB*TE**4 + 2.30137E-09_EB*TE**3 - &
             4.58815E-06_EB*TE**2 + 7.74549E-04_EB*TE - 2.72484E+02_EB !kJ/mol
   CASE('HYDROGEN PEROXIDE') ! H2O2 (NASA/TP-2002-211556)
      IF (TE<1000._EB) THEN
         CP = -92795.3358_EB*TE**(-2)+1564.748385_EB/TE-5.97646014_EB+0.0327074452_EB*TE-0.0000393219326_EB*TE**2+&
            0.00000002509255235_EB*TE**3-6.46504529E-12_EB*TE**4
      ELSE
         CP = 1489428.027_EB*TE**(-2)-5170.82178_EB/TE+11.2820497_EB-0.0000804239779_EB*TE-0.00000001818383769_EB*TE**2+&
            6.94726559E-12_EB*TE**3-4.8278319E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 34.01468_EB !J/kg/K
      H = -4341036.51182906_EB !J/kg
      G_F = -1.29850E-08_EB*TE**3 + 3.81914E-05_EB*TE**2 + 7.71134E-02_EB*TE - 1.30792E+02_EB !kJ/mol (JANAF)
   CASE('HYDROGEN SULFIDE') ! H2S (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 9543.80881_EB*TE**(-2)-68.7517508_EB/TE+4.05492196_EB-0.0003014557336_EB*TE+0.00000376849775_EB*TE**2 &
            -0.000000002239358925_EB*TE**3+3.086859108E-13_EB*TE**4
      ELSE
         CP = 1430040.22_EB*TE**(-2)-5284.02865_EB/TE+10.16182124_EB-0.000970384996_EB*TE+0.0000002154003405_EB*TE**2 &
            -0.000000000021696957_EB*TE**3+9.31816307E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 34.08088_EB !J/kg/K
      H = -897999.575079375_EB !J/kg
   CASE('HYDROXYL RADICAL') ! OH (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -1998.85899_EB*TE**(-2)+93.0013616_EB/TE+3.050854229_EB+0.001529529288_EB*TE-0.000003157890998_EB*TE**2+&
            0.00000000331544618_EB*TE**3-1.138762683E-12_EB*TE**4
      ELSE
         CP = 1017393.379_EB*TE**(-2)-2509.957276_EB/TE+5.11654786_EB+0.000130529993_EB*TE-0.0000000828432226_EB*TE**2+&
            2.006475941E-11_EB*TE**3-1.556993656E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 17.00734_EB !J/kg/K
      H = 1659017.19837437_EB !J/kg
      G_F = 3.52765E-07_EB*TE**2 - 1.53580E-02_EB*TE + 3.85977E+01_EB !kJ/mol (JANAF)
   CASE('HYDROPEROXY RADICAL') ! HO2 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -75988.8254_EB*TE**(-2)+1329.383918_EB/TE-4.67738824_EB+0.02508308202_EB*TE-0.00003006551588_EB*TE**2+&
            0.00000001895600056_EB*TE**3-4.82856739E-12_EB*TE**4
      ELSE
         CP = -1810669.724_EB*TE**(-2)+4963.19203_EB/TE-1.039498992_EB+0.00456014853_EB*TE-0.000001061859447_EB*TE**2+&
            1.144567878E-10_EB*TE**3-4.76306416E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 33.00674_EB !J/kg/K
      H = 59910.991175073_EB !J/kg
      G_F = 7.37353E-14_EB*TE**4 - 9.82449E-10_EB*TE**3 + 4.44088E-06_EB*TE**2 + 4.07813E-02_EB*TE + &
              2.44630E+00_EB !kJ/mol
   CASE('HELIUM') ! He (JANAF)
      CP = 20.786_EB !J/mol/K
      CP = CP / 4.002602_EB * 1000._EB !J/kg/K
      H = -1548329.287_EB !J/kg
   CASE('ISOPROPANOL') !NIST webbook
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -338651.024_EB*TE**(-2)+6106.048_EB/TE-37.9141804_EB+0.1530494531_EB*TE-0.0001864354461_EB*TE**2+&
            0.0000001213257738_EB*TE**3-3.22043349E-11_EB*TE**4
      ELSE
         CP = 6001074.75_EB*TE**(-2)-25058.7683_EB/TE+46.2209612_EB-0.00427246631_EB*TE+0.000000769367877_EB*TE**2 &
            -7.45058484E-11_EB*TE**3+2.998959935E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 60.09502_EB !J/kg/K
      H = -4893841.16410384_EB !J/kg
      FUEL = .TRUE.
   CASE('METHANE') !CH4 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -176685.0998_EB*TE**(-2)+2786.18102_EB/TE-12.0257785_EB+0.0391761929_EB*TE-0.0000361905443_EB*TE**2+&
            0.00000002026853043_EB*TE**3-4.97670549E-12_EB*TE**4
      ELSE
         CP = 3730042.76_EB*TE**(-2)-13835.01485_EB/TE+20.49107091_EB-0.001961974759_EB*TE+0.000000472731304_EB*TE**2 &
            -3.72881469E-11_EB*TE**3+1.623737207E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 16.04246_EB !J/kg/K
      H = -5278154.36989869_EB !J/kg
      G_F = 2.60520E-13_EB*TE**4 - 3.53984E-09_EB*TE**3 + 1.65270E-05_EB*TE**2 + 8.11587E-02_EB*TE - 7.47714E+01_EB !kJ/mol
      FUEL = .TRUE.
   CASE('METHANOL') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -241664.2886_EB*TE**(-2)+4032.14719_EB/TE-20.46415436_EB+0.0690369807_EB*TE-0.0000759893269_EB*TE**2+&
            0.0000000459820836_EB*TE**3-1.158706744E-11_EB*TE**4
      ELSE
         CP = 3411570.76_EB*TE**(-2)-13455.00201_EB/TE+22.61407623_EB-0.002141029179_EB*TE+0.000000373005054_EB*TE**2 &
            -3.49884639E-11_EB*TE**3+1.366073444E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 32.04186_EB !J/kg/K
      H = -6646081.44513795_EB !J/kg
      FUEL = .TRUE.
   CASE('N-DECANE') !C10H22 NIST Webbook
      TE = MAX(MIN(TE,1500._EB),200._EB)
      CP = 0.00000000099797_EB*TE**4 - 0.00000269748_EB*TE**3 + 0.000414125_EB*TE**2 + 4.77349_EB*TE + 267.016_EB !J/kg/K
      H = -2140243.363_EB !J/kg
      FUEL = .TRUE.
   CASE('N-HEPTANE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -612743.289_EB*TE**(-2)+11840.85437_EB/TE-74.871886_EB+0.2918466052_EB*TE-0.000341679549_EB*TE**2+&
            0.0000002159285269_EB*TE**3-5.65585273E-11_EB*TE**4
      ELSE
         CP = 9135632.47_EB*TE**(-2)-39233.1969_EB/TE+78.8978085_EB-0.00465425193_EB*TE+0.000002071774142_EB*TE**2 &
            -0.00000000034425393_EB*TE**3+1.976834775E-14_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 100.20194_EB !J/kg/K
      H = -2271108.89867194_EB !J/kg
      FUEL = .TRUE.
   CASE('N-HEXANE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -581592.67_EB*TE**(-2)+10790.97724_EB/TE-66.3394703_EB+0.2523715155_EB*TE-0.0002904344705_EB*TE**2+&
            0.0000001802201514_EB*TE**3-4.61722368E-11_EB*TE**4
      ELSE
         CP = -3106625.684_EB*TE**(-2)-7346.08792_EB/TE+46.9413176_EB+0.001693963977_EB*TE+0.000002068996667_EB*TE**2 &
            -0.000000000421214168_EB*TE**3+2.452345845E-14_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 86.17536_EB !J/kg/K
      H = -2336770.33904175_EB !J/kg
      FUEL = .TRUE.
   CASE('N-OCTANE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -698664.715_EB*TE**(-2)+13385.01096_EB/TE-84.1516592_EB+0.327193666_EB*TE-0.000377720959_EB*TE**2+&
            0.0000002339836988_EB*TE**3-6.01089265E-11_EB*TE**4
      ELSE
         CP = 6365406.95_EB*TE**(-2)-31053.64657_EB/TE+69.6916234_EB+0.01048059637_EB*TE-0.00000412962195_EB*TE**2+&
            0.000000000554322632_EB*TE**3-2.651436499E-14_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 112.21264_EB !J/kg/K
      H = -2262692.0051528_EB !J/kg
      FUEL = .TRUE.
   CASE('NITRIC OXIDE') ! NO (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -11439.16503_EB*TE**(-2)+153.6467592_EB/TE+3.43146873_EB-0.002668592368_EB*TE+0.00000848139912_EB*TE**2 &
            -0.00000000768511105_EB*TE**3+2.386797655E-12_EB*TE**4
      ELSE
         CP = 223901.8716_EB*TE**(-2)-1289.651623_EB/TE+5.43393603_EB-0.00036560349_EB*TE+0.0000000988096645_EB*TE**2 &
            -1.416076856E-11_EB*TE**3+9.38018462E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 30.0061_EB !J/kg/K
      H = 2740399.25832862_EB !J/kg
   CASE('NITROGEN') !N2 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 22103.71497_EB*TE**(-2)-381.846182_EB/TE+6.08273836_EB-0.00853091441_EB*TE+0.00001384646189_EB*TE**2 &
            -0.00000000962579362_EB*TE**3+2.519705809E-12_EB*TE**4
      ELSE
         CP = 587712.406_EB*TE**(-2)-2239.249073_EB/TE+6.06694922_EB-0.00061396855_EB*TE+0.0000001491806679_EB*TE**2 &
            -1.923105485E-11_EB*TE**3+1.061954386E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 28.0134_EB !J/kg/K
      H = -309806.566683287_EB !J/kg
   CASE('NITROGEN ATOM') ! N (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,1000._EB))
      CP = 88765.0138_EB*TE**(-2)-107.12315_EB/TE+2.362188287_EB+0.0002916720081_EB*TE-0.00000017295151_EB*TE**2+&
         4.01265788E-11_EB*TE**3-2.677227571E-15_EB*TE**4
      CP = CP * 8314.472_EB / 14.0067_EB !J/kg/K
      H = 33057650.9780654_EB !J/kg
      G_F = -7.26086E-07_EB*TE**2 - 6.29553E-02_EB*TE + 4.74723E+02_EB !kJ/mol
   CASE('NITROGEN DIOXIDE') !NO2 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -56420.3878_EB*TE**(-2)+963.308572_EB/TE-2.434510974_EB+0.01927760886_EB*TE-0.00001874559328_EB*TE**2+&
            0.00000000914549773_EB*TE**3-1.777647635E-12_EB*TE**4
      ELSE
         CP = 721300.157_EB*TE**(-2)-3832.6152_EB/TE+11.13963285_EB-0.002238062246_EB*TE+0.000000654772343_EB*TE**2 &
            -0.000000000076113359_EB*TE**3+3.32836105E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 46.0055_EB !J/kg/K
      H = 517027.500939828_EB !J/kg
   CASE('NITROUS OXIDE') !N2O (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 42882.2597_EB*TE**(-2)-644.011844_EB/TE+6.03435143_EB+0.0002265394436_EB*TE+0.00000347278285_EB*TE**2 &
            -0.00000000362774864_EB*TE**3+1.137969552E-12_EB*TE**4
      ELSE
         CP = 343844.804_EB*TE**(-2)-2404.557558_EB/TE+9.12563622_EB-0.000540166793_EB*TE+0.0000001315124031_EB*TE**2 &
            -0.000000000014142151_EB*TE**3+6.38106687E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 44.0128_EB !J/kg/K
      H = 1620495.26500717_EB !J/kg
      G_F = -8.47894E-07_EB*TE**2 + 7.35106E-02_EB*TE + 8.33575E+01_EB !kJ/mol
   CASE('OXYGEN') !O2 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -34255.6342_EB*TE**(-2)+484.700097_EB/TE+1.119010961_EB+0.00429388924_EB*TE-0.000000683630052_EB*TE**2 &
            -0.0000000020233727_EB*TE**3+1.039040018E-12_EB*TE**4
      ELSE
         CP = -1037939.022_EB*TE**(-2)+2344.830282_EB/TE+1.819732036_EB+0.001267847582_EB*TE-0.0000002188067988_EB*TE**2+&
            2.053719572E-11_EB*TE**3-8.19346705E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 31.9988_EB !J/kg/K
      H = -271678.662691491_EB !J/kg
   CASE('OXYGEN ATOM') ! O (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -7953.6113_EB*TE**(-2)+160.7177787_EB/TE+1.966226438_EB+0.00101367031_EB*TE-0.000001110415423_EB*TE**2+&
            0.00000000065175075_EB*TE**3-1.584779251E-13_EB*TE**4
      ELSE
         CP = 261902.0262_EB*TE**(-2)-729.872203_EB/TE+3.31717727_EB-0.000428133436_EB*TE+0.0000001036104594_EB*TE**2 &
            -9.43830433E-12_EB*TE**3+2.725038297E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 15.9994_EB !J/kg/K
      H = 15153184.6096168_EB !J/kg
      G_F = -4.50350E-07_EB*TE**2 - 6.41499E-02_EB*TE + 2.51175E+02_EB !kJ/mol
   CASE('PROPANE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -243314.4337_EB*TE**(-2)+4656.27081_EB/TE-29.39466091_EB+0.1188952745_EB*TE-0.0001376308269_EB*TE**2+&
            0.0000000881482391_EB*TE**3-2.342987994E-11_EB*TE**4
      ELSE
         CP = 6420731.68_EB*TE**(-2)-26597.91134_EB/TE+45.3435684_EB-0.00502066392_EB*TE+0.000000947121694_EB*TE**2 &
            -9.57540523E-11_EB*TE**3+4.00967288E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 44.09562_EB !J/kg/K
      H = -2771726.83112595_EB !J/kg
      FUEL = .TRUE.
   CASE('PROPYLENE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -191246.2174_EB*TE**(-2)+3542.07424_EB/TE-21.14878626_EB+0.0890148479_EB*TE-0.0001001429154_EB*TE**2&
            +0.0000000626795939_EB*TE**3-1.637870781E-11_EB*TE**4
      ELSE
         CP = 5017620.34_EB*TE**(-2)-20860.84035_EB/TE+36.4415634_EB-0.00388119117_EB*TE+0.000000727867719_EB*TE**2 &
            -0.000000000073212045_EB*TE**3+3.052176369E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 42.07974_EB !J/kg/K
      H = 102862.326771286_EB !J/kg
      FUEL = .TRUE.
   CASE('SOOT')
      TE = MAX(TE,100._EB)
      CP = -367.0215_EB-377212.2_EB/TE**2+12303.11_EB/TE-0.07902181_EB*TE+0.00002325095_EB*TE**2-0.000000004567174_EB*TE**3+ &
            0.00000000000049475_EB*TE**4-2.218908E-17_EB*TE**5+63.20294*LOG(TE) !J/mol/K
      CP = CP / 12.0107_EB * 1000._EB !J/kg/K
      H = -98482.09405_EB !J/kg
   CASE('SULFUR DIOXIDE') !SO2 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -53108.4214_EB*TE**(-2)+909.031167_EB/TE-2.356891244_EB+0.02204449885_EB*TE-0.00002510781471_EB*TE**2&
            +0.00000001446300484_EB*TE**3-3.36907094E-12_EB*TE**4
      ELSE
         CP = -112764.0116_EB*TE**(-2)-825.226138_EB/TE+7.61617863_EB-0.000199932761_EB*TE+0.0000000565563143_EB*TE**2 &
            -5.45431661E-12_EB*TE**3+2.918294102E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 64.0638_EB !J/kg/K
      H = -4804972.34881129_EB !J/kg
      G_F = -2.35202E-16_EB*TE**5 + 4.23735E-12_EB*TE**4 - 2.88066E-08_EB*TE**3 + 9.13587E-05_EB*TE**2 - &
             6.03611E-02_EB*TE - 2.91661E+02_EB !kJ/mol
   CASE('SULFUR HEXAFLUORIDE') !SF6 (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 330952.674_EB*TE**(-2)-4737.68505_EB/TE+22.47738068_EB+0.01046954309_EB*TE-0.00002560641961_EB*TE**2+&
            0.00000002153716967_EB*TE**3-6.51609896E-12_EB*TE**4
      ELSE
         CP = -730672.65_EB*TE**(-2)-636.705655_EB/TE+19.47442853_EB-0.0001894325671_EB*TE+0.0000000417872283_EB*TE**2 &
            -4.78374495E-12_EB*TE**3+2.213516129E-16_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 146.0554192_EB !J/kg/K
      H = -8499592.97262807_EB !J/kg
      G_F = -1.44295E-09_EB*TE**3 + 1.13929E-05_EB*TE**2 + 3.74503E-01_EB*TE - 1.22962E+03_EB !kJ/mol
   CASE('TOLUENE') !NASA/TP-2002-211556
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -287796.222_EB*TE**(-2)+6133.94152_EB/TE-45.7470676_EB+0.1936895724_EB*TE-0.0002304305304_EB*TE**2+&
            0.0000001459301178_EB*TE**3-0.000000000037907961_EB*TE**4
      ELSE
         CP = 6184538.35_EB*TE**(-2)-29902.84056_EB/TE+59.8200597_EB-0.00569698396_EB*TE+0.000001080748416_EB*TE**2 &
            -1.098702235E-10_EB*TE**3+4.62474022E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 92.13842_EB !J/kg/K
      H = 302241.602293476_EB !J/kg
      FUEL = .TRUE.
   CASE('WATER VAPOR') !H2O (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = -39479.6083_EB*TE**(-2)+575.573102_EB/TE+0.931782653_EB+0.00722271286_EB*TE-0.00000734255737_EB*TE**2+&
            0.00000000495504349_EB*TE**3-1.336933246E-12_EB*TE**4
      ELSE
         CP = 1034972.096_EB*TE**(-2)-2412.698562_EB/TE+4.64611078_EB+0.002291998307_EB*TE-0.000000683683048_EB*TE**2+&
            9.42646893E-11_EB*TE**3-4.82238053E-15_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 18.01528_EB !J/kg/K
      H = -13975841.0717241_EB !J/kg
      G_F = -2.29410E-10_EB*TE**3 + 2.74187E-06_EB*TE**2 + 4.89267E-02_EB*TE - 2.43003E+02_EB !kJ/mol
   CASE('XENON') !H2O (NASA/TP-2002-211556)
      TE = MIN(6000._EB,MAX(TE,200._EB))
      IF (TE<1000._EB) THEN
         CP = 0_EB*TE**(-2)+0_EB/TE+2.5_EB+0_EB*TE+0_EB*TE**2+0_EB*TE**3+0_EB*TE**4
      ELSE
         CP = 4025.22668_EB*TE**(-2)-12.09507521_EB/TE+2.514153347_EB-0.00000824810208_EB*TE+0.000000002530232618_EB*TE**2 &
            -3.89233323E-13_EB*TE**3+2.360439138E-17_EB*TE**4
      ENDIF
      CP = CP * 8314.472_EB / 131.293_EB !J/kg/K
      H = -71027.5860505296_EB !J/kg
END SELECT

END SUBROUTINE JANAF_TABLE


SUBROUTINE JANAF_TABLE_LIQUID(I_TMP,CP,H_V,H_L,T_REF,T_MELT,T_BOIL,SPEC_ID,FUEL,DENSITY,MU,K,BETA)
!CP data in this subroutine is taken from 4th Edition of the NIST-JANAF Thermochemical Tables
!The tabulated data in the tables have been curve fit
!For each species CP is first computed in kJ/mol/K and then converted to J/kg/K
CHARACTER(LABEL_LENGTH), INTENT(IN) ::SPEC_ID
INTEGER, INTENT(IN) :: I_TMP
REAL(EB), INTENT(INOUT) :: CP,H_V,H_L,T_REF,T_MELT,T_BOIL,DENSITY,MU,K,BETA
REAL(EB) :: T
LOGICAL,INTENT(OUT) :: FUEL

FUEL = .FALSE.

!Default to water properteis
BETA = 0.000889_EB !1/K (H2O)
MU = 0.00089_EB !Ns/m^2 (H2O)
K = 0.6 !W/m/K (H2O)

SELECT CASE (SPEC_ID)
   CASE('ACETONE') !JPCRD 6
      T = MIN(331.6_EB,MAX(180.3_EB,REAL(I_TMP,EB)))*0.01_EB
      IF (T<180.3_EB) THEN
         CP = (30.9466_EB-22.1705_EB*T+9.34675_EB*T**2-1.24165_EB*T**3)*8314.472_EB/58.07914_EB !J/kg
      ELSE
         CP = (-23.6004_EB+40.7683_EB*T-14.8605_EB*T**2+1.86185_EB*T**3)*8314.472_EB/58.07914_EB !J/kg
      ENDIF
      H_L = -4913382.973_EB !J/kg
      H_V = 538919.8256_EB !J/kg
      T_REF = 329.3_EB !K
      T_MELT = 178.7_EB !K
      T_BOIL = 329.3_EB !K
      DENSITY = 791._EB !kg/m^3
      MU = 0.000316_EB !N.s/m^2
      K = 0.180_EB !W/m/K
      FUEL = .TRUE.
      BETA = 0.00148_EB !1/K
   !CASE('ACETYLENE') sublimation
   CASE('ACROLEIN')
      T = MIN(340._EB,MAX(290._EB,REAL(I_TMP,EB)))
      CP = 4.17143_EB*T+762._EB !J/kg/K
      H_L = -6019933.031_EB !J/kg
      H_V = 663470.8757_EB !J/kg
      T_REF = 186.15_EB !K
      T_MELT = 186.15_EB !K
      T_BOIL = 330._EB !K
      DENSITY = 846._EB !kg/m^3
   CASE('AMMONIA')
      T = MIN(298.15_EB,MAX(200._EB,REAL(I_TMP,EB)))
      CP = 0.0286941_EB*T**2 - 8.6568_EB*T + 4903.55_EB
      H_L = -5230031.933_EB !J/kg
      H_V = 1374003.847211_EB !J/kg
      T_REF = 239.8_EB !K
      T_MELT = 194.95_EB !K
      T_BOIL = 239.8_EB !K
      DENSITY = 730._EB !kg/m^3
      MU = 138E-6_EB  !N.s/m^2
      K = 0.521_EB !W/m/K
      BETA = 0.00250_EB !1/K
   CASE('ARGON')
      CP = 1110._EB !J/kg/K
      H_L = -368780.2906 !J/kg
      H_V = 164230.3215_EB !J/kg
      T_REF = 83.8_EB !K
      T_MELT = 83.8_EB !K
      T_BOIL = 87.29_EB !K
      DENSITY = 1430._EB !kg/m^3
      K = 0.123_EB !W/m/K
      MU = 0.000252_EB !N.s/m^2
      BETA = 0.011_EB !1/K
   CASE('BENZENE')  !NASA/TP-2002-211556
      T = MIN(500._EB,MAX(REAL(I_TMP,EB),278.68_EB))
      CP = -2291003.94_EB*T**(-2)+36920.5816_EB/T-182.0019971_EB+0.2634137216_EB*T+0.000974258592_EB*T**2 &
         -0.00000330790915_EB*T**3+0.000000002888191394_EB*T**4
      CP = CP * 8314.472_EB / 78.11184_EB !J/kg/K
      H_L = -3087801.641_EB !J/kg
      H_V = 477460.8131_EB !J/kg
      T_REF = 278.64_EB !K
      T_MELT = 278.64_EB !K
      T_BOIL = 353.3_EB !K
      DENSITY= 876.50_EB !kg/m^3
      MU = 0.00601_EB  !N.s/m^2
      K = 0.167_EB !W/m/K
      BETA = 0.00114_EB !1/K
      FUEL = .TRUE.
   CASE('BUTANE')
      T = MIN(240._EB,MAX(100._EB,REAL(I_TMP,EB)))
      CP = 1.00177E-04_EB*T**3 - 5.23290E-02_EB*T**2 + 1.08908E+01_EB*T + 1.17542E+03_EB!J/kg/K
      H_L = -3161626.961_EB !J/kg
      H_V = 440269.1313_EB !J/kg
      T_REF = 136._EB !K
      T_MELT = 136._EB !K
      T_BOIL = 272.66_EB !K
      DENSITY = 600._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.117_EB !W/m/K
      MU = 0.000228_EB  !N.s/m^2
      BETA = 0.00207_EB !1/K
   !CASE('CARBON DIOXIDE') sublimation
   CASE('CARBON MONOXIDE')
      T = MIN(85._EB,MAX(65._EB,REAL(I_TMP,EB)))
      CP = 2.94_EB*T+1.9319E3_EB !J/kg/K
      H_L = -4730890.238_EB !J/kg
      H_V = 374327.1563_EB !J/kg
      T_REF = 67.95_EB !K
      T_MELT = 67.95_EB !K
      T_BOIL = 81.63_EB !K
      DENSITY = 788.6_EB !kg/m^3
   CASE('CHLORINE')
      T = MIN(230._EB,MAX(180._EB,REAL(I_TMP,EB)))
      CP = -0.0025_EB*T**2+0.747857_EB*T+891.314_EB !J/kg
      H_L = 3379249.127 !J/kg
      H_V = 287790._EB !J/kg
      T_REF = 238.55_EB !K
      T_MELT = 172.17_EB !K
      T_BOIL = 238.55_EB !K
      DENSITY = 1565.5_EB !kg/m^3
      MU = 0.000343_EB  !N.s/m^2
      K = 0.190_EB !W/m/K
      BETA = 0.00219_EB !1/K
   CASE('DODECANE')
      T = MIN(480._EB,MAX(270._EB,REAL(I_TMP,EB)))
      CP = 8.26087E-03_EB*T**2-2.17962E+00_EB*T+2.12506E+03_EB !J/kg/K
      H_L = -2030175.233_EB !J/kg
      H_V = 201955.2082_EB !J/kg
      T_REF = 489.2_EB !K
      T_MELT = 263.5_EB !K
      T_BOIL = 489.2_EB !K
      DENSITY = 750._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.140_EB !W/m/K
      MU = 0.00134_EB !N.s/m^2
      BETA = 0.00114_EB !1/K (Octane)
   CASE('ETHANE')
      T = MIN(240._EB,MAX(100._EB,REAL(I_TMP,EB)))
      CP = 1.08053E-04_EB*T**3 - 2.27232E-02_EB*T**2 + 1.55254E+00_EB*T + 2.24672E+03_EB !J/kg/K
      H_L = -3889291.249_EB !J/kg
      H_V = 577854.0716_EB !J/kg
      T_REF = 100._EB !K
      T_MELT = 100._EB !K
      T_BOIL = 184.32_EB !K
      DENSITY = 546._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.167_EB !W/m/K
      MU = 0.000163_EB !N.s/m^2
      BETA = 0.00114_EB !1/K (butane)
   CASE('ETHANOL') !NASA/TP-2002-211556
      T = MIN(390._EB,MAX(REAL(I_TMP,EB),159._EB))
      CP = 450111.594_EB*T**(-2)-10208.2899_EB/T+101.426678_EB-0.387467261_EB*T+0.000712139261_EB*T**2 &
         -0.000000185707145_EB*T**3+0.000000000203762257_EB*T**4
      CP = CP * 8314.472_EB / 46.06844_EB !J/kg/K
      H_L = -6656155.11985071_EB !J/kg
      H_V = 1075147.11328518_EB !J/kg
      T_REF = 159.0_EB !K
      T_MELT = 159.0_EB !K
      T_BOIL = 351.5_EB !K
      DENSITY = 790._EB !kg/m^3
      FUEL = .TRUE.
      MU = 0.001095_EB  !N.s/m^2
      K = 0.203_EB !W/m/K
      BETA = 0.00118_EB !1/K
   CASE('ETHYLENE')
      T = MIN(170._EB,MAX(110._EB,REAL(I_TMP,EB)))
      CP = -8.88178E-16_EB*T**3 + 2.28571E-02_EB*T**2 - 7.40000E+00_EB*T + 2.99329E+03_EB !J/kg/K
      H_L = 488120.9219_EB !J/kg
      H_V = 871622.6364_EB !J/kg
      T_REF = 103.8_EB !K
      T_MELT = 103.8_EB !K
      T_BOIL = 169.38_EB !K
      DENSITY = 569._EB !kg/m^3
      FUEL = .TRUE.
      MU = 0.000038_EB  !N.s/m^2
      K = 0.2568_EB !W/m/K
      BETA = 0.00114_EB !1/K (butane)
   CASE('FORMALDEHYDE')
      CP = 1180._EB !J/kg/K
      H_L = -4776499.151_EB !J/kg
      H_V = 809299.1469_EB !J/kg
      T_REF = 236._EB !K
      T_MELT = 181._EB !K
      T_BOIL = 254._EB !K
      DENSITY = 812._EB !kg/m^3
   CASE('HELIUM')
      T = MIN(4.22_EB,MAX(1.4_EB,REAL(I_TMP,EB)))
      CP = 5.62684E-01_EB*T**3 - 4.40229E+00_EB*T**2 + 1.17485E+01_EB*T - 8.45057E+00_EB!kJ/kg/K
      CP = CP*1000._EB !J/kg/K
      H_L = -1555906.534_EB !J/kg
      H_V = 20754._EB !J/kg
      T_REF = 0._EB !K
      T_MELT = 0._EB !K
      T_BOIL = 4.22_EB !K
      DENSITY = 125._EB !kg/m^3
      K = 0.0272 !W/m/K
      MU = 0.00000357_EB !N.s/m^2
      BETA = 0.0818_EB !1/K
   CASE('HYDROGEN')
      T = MIN(21._EB,MAX(14._EB,REAL(I_TMP,EB)))
      CP = 445._EB*T+405._EB !J/kg/K
      H_L = -4406621.245_EB !J/kg
      H_V = 404754.6321_EB !J/kg
      T_REF = 14._EB !K
      T_MELT = 14._EB !K
      T_BOIL = 20.28_EB !K
      DENSITY = 71._EB !kg/m^3
      K = 0.1185_EB !W/m/K
      MU = 0.0000131_EB !N.s/m^2
      BETA = 0.0209_EB !1/K
   CASE('HYDROGEN BROMIDE')
      T = MIN(205._EB,MAX(190._EB,REAL(I_TMP,EB)))
      CP = 0.52_EB*T+635.3!J/kg/K
      H_L = -903964.2804_EB !J/kg
      H_V = 278499.9834_EB !J/kg
      T_REF = 186.1_EB !K
      T_MELT = 186.1_EB !K
      T_BOIL = 206.35_EB !K
      DENSITY = 2140._EB !kg/m^3
   CASE('HYDROGEN CHLORIDE')
      T = MIN(185._EB,MAX(160._EB,REAL(I_TMP,EB)))
      CP = 0.925714_EB*T+1442.65!J/kg/K
      H_L = -3362347.042_EB !J/kg
      H_V = 464812.7099_EB !J/kg
      T_REF = 161.15_EB !K
      T_MELT = 161.15_EB !K
      T_BOIL = 188.05_EB !K
      DENSITY = 1191._EB !kg/m^3
      MU = 0.000067_EB  !N.s/m^2
      K = 0.231_EB !W/m/K
      BETA = 0.00709_EB !1/K
   CASE('HYDROGEN CYANIDE')
      T = MIN(85._EB,MAX(70._EB,REAL(I_TMP,EB)))
      CP = 2.94_EB*T+1931.9_EB!J/kg/K
      H_L = 3342978.123_EB !J/kg
      H_V = 967993.1926_EB !J/kg
      T_REF = 260._EB !K
      T_MELT = 260._EB !K
      T_BOIL = 298.85_EB !K
      DENSITY = 689._EB !kg/m^3
      MU = 0.000188_EB !N.s/m^2
      K = 0.243_EB !W/m/K
      BETA = 0.0222_EB !1/K
   CASE('HYDROGEN FLUORIDE')
      T = MIN(290._EB,MAX(200._EB,REAL(I_TMP,EB)))
      CP = -6.21601E-06_EB*T**3 + 3.62354E-02_EB*T**2 - 1.23566E+01_EB*T + 3.22662E+03_EB!J/kg/K
      H_L = -15154807.3_EB !J/kg
      H_V = 460008.5869_EB !J/kg
      T_REF = 190._EB !K
      T_MELT = 190._EB !K
      T_BOIL = 292.5_EB !K
      DENSITY = 991._EB !kg/m^3
   CASE('HYDROGEN PEROXIDE')
      T = MIN(350._EB,MAX(290._EB,REAL(I_TMP,EB)))
      CP = 2.1107_EB*T+783.43!J/kg/K
      H_L = -5820426.143 !J/kg
      H_V = 1387000._EB !J/kg
      T_REF = 423.3_EB !K
      T_MELT = 272.72_EB !K
      T_BOIL = 423.3_EB !K
      DENSITY = 1450._EB !kg/m^3
      MU = 0.001189_EB !N.s/m^2
      K = 0.363_EB !W/m/K
      BETA = 0.00225_EB !1/K
   CASE('HYDROGEN SULFIDE')
      T = MIN(190._EB,MAX(210._EB,REAL(I_TMP,EB)))
      CP = 1866.8_EB+0.64_EB*T !J/kg/K
      H_L = -1706808.09986696_EB !J/kg
      H_V = 607378.682710089_EB !J/kg
      T_REF = 200._EB !K
      T_MELT = 190.85_EB !K
      T_BOIL = 212.87_EB !K
      DENSITY = 1360._EB !kg/m^3
   CASE('ISOPROPANOL')
      T = MIN(430._EB,MAX(190._EB,REAL(I_TMP,EB)))
      CP = -2.34629E-04_EB*T**3 + 2.35666E-01_EB*T**2 - 6.55874E+01_EB*T + 7.42454E+03_EB!J/kg/K
      H_L = -6209646.309_EB !J/kg
      H_V = 882038.0541_EB !J/kg
      T_REF = 185._EB !K
      T_MELT = 185._EB !K
      T_BOIL = 370.57_EB !K
      DENSITY = 785._EB !kg/m^3
      FUEL = .TRUE.
      MU = 0.00194_EB !N.s/m^2
      K = 0.178_EB !W/m/K
      BETA = 0.00113_EB !1/K
   CASE('METHANE')
      T = MIN(140._EB,MAX(100._EB,REAL(I_TMP,EB)))
      CP = 2.33333E-03_EB*T**3 - 6.75000E-01_EB*T**2 + 7.17167E+01_EB*T + 6.17400E+02_EB !J/kg/K
      H_L = -5932238.079_EB !J/kg
      H_V = 537767.9796_EB !J/kg
      T_REF = 90.6_EB !K
      T_MELT = 90.6_EB !K
      T_BOIL = 111.63_EB !K
      DENSITY = 422._EB !kg/m^3
      K = 0.189_EB !W/m/K
      MU = 0.000118_EB !N.s/m^2
   CASE('METHANOL')  !NASA/TP-2002-211556
         T = MIN(500._EB,MAX(REAL(I_TMP,EB),278.68_EB))
         CP = -1302004.763_EB*T**(-2)+31669.8418_EB/T-303.1242152_EB+1.60223113_EB*T-0.00459450734_EB*T**2+&
            0.00000699017831_EB*T**3-0.00000000420738895_EB*T**4
         CP = CP * 8314.472_EB / 32.04186_EB !J/kg/K
         H_L = -8180802.98866788_EB !J/kg
         H_V = 1324775.99580504_EB !J/kg
      T_REF = 176.6_EB !K
      T_MELT = 176.6_EB !K
      T_BOIL = 337.7_EB !K
      DENSITY = 792._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.212_EB !W/m/K
      MU = 0.00056_EB !N.s/m^2
      BETA = 0.00115_EB !1/K
   CASE('N-DECANE') ! JPCRD 6
      T = MIN(462.4_EB,MAX(247._EB,REAL(I_TMP,EB)))*0.01_EB
      IF (T < 314._EB) THEN
         CP = (83.3283_EB-51.0491_EB*T+17.0127_EB*T**2-1.6806_EB*T**3)*8314.472_EB/142.2817_EB !J/kg/K
      ELSE
         CP = (35.5264_EB-5.37839_EB*T+2.46788_EB*T**2-0.136562_EB*T**3)*8314.472_EB/142.2817_EB !J/kg/K
      ENDIF
      H_L = -2818574.716_EB !J/kg
      H_V = 360552.3916 !J/kg
      T_REF = 447.2 !K
      T_MELT = 243.3 !K
      T_BOIL = 447.2 !K
      DENSITY = 730._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.147_EB !W/m/K
      MU = 0.000859_EB !N.s/m^2
      BETA = 0.00108_EB !1/K
   CASE('N-HEPTANE') !NASA/TP-2002-211556
      T = MIN(380.0007_EB,MAX(REAL(I_TMP,EB),182.58_EB))
      CP = 1759947.367_EB*T**(-2)-37493.9679_EB/T+396.30649_EB-2.117827431_EB*T+0.00682824867_EB*T**2 &
           -0.00001131862116_EB*T**3+0.00000000773686013_EB*T**4
      CP = CP * 8314.472_EB / 100.20194_EB !J/kg/K
      H_L = -2849849.72206429_EB !J/kg
      H_V = 441630.258757732_EB !J/kg
      T_REF = 182.58_EB !K
      T_MELT = 182.58_EB !K
      T_BOIL = 371.50_EB !K
      DENSITY = 684._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.140_EB !W/m/K
      MU = 0.000376_EB !N.s/m^2
      BETA = 0.00124_EB !1/K
   CASE('N-HEXANE') !NASA/TP-2002-211556
      T = MIN(300.0007_EB,MAX(REAL(I_TMP,EB),177.86_EB))
      CP = 7721016.13_EB*T**(-2)-224929.8616_EB/T+2717.090647_EB-16.98251992_EB*T+0.0590721518_EB*T**2 &
         -0.0001074528475_EB*T**3+0.0000000802423827_EB*T**4
      CP = CP * 8314.472_EB / 86.17536_EB !J/kg/K
      H_L = -2906561.73248515_EB !J/kg
      H_V = 444304.310724934_EB !J/kg
      T_REF = 178.1_EB !K
      T_MELT = 178.1_EB !K
      T_BOIL = 342.44_EB !K
      DENSITY = 659._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.124_EB !W/m/K
      MU = 0.000297_EB !N.s/m^2
      BETA = 0.00138_EB !1/K
   CASE('N-OCTANE') !NASA/TP-2002-211556
      T = MIN(400.0007_EB,MAX(REAL(I_TMP,EB),216.37_EB))
      CP = -16833148.26_EB*T**(-2)+353261.508_EB/T-2967.857531_EB+13.16703807_EB*T-0.0318682241_EB*T**2+&
         0.0000407574801_EB*T**3-0.00000002153277285_EB*T**4
      CP = CP * 8314.472_EB / 112.21264_EB !J/kg/K
      H_L = -2853476.75881395_EB !J/kg
      H_V = 422688.947366284_EB !J/kg
      T_REF = 216.3_EB !K
      T_MELT = 216.3_EB !K
      T_BOIL = 398.44_EB !K
      DENSITY = 703._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.147_EB !W/m/K
      MU = 0.00051_EB !N.s/m^2
      BETA = 0.00114_EB !1/K
   CASE('NITRIC OXIDE')
      T = MIN(122._EB,MAX(110._EB,REAL(I_TMP,EB)))
      CP =  54.38_EB*T - 3926.9_EB!J/kg/K
      H_L = 2165966.523!J/kg
      H_V = 460000._EB !J/kg
      T_REF = 110._EB !K
      T_MELT = 110._EB !K
      T_BOIL = 122._EB !K
      DENSITY = 1270._EB !kg/m^3
   CASE('NITROGEN')
      T = MIN(90._EB,MAX(65._EB,REAL(I_TMP,EB)))
      CP = 1.72593E-02_EB*T**3 - 3.93206E+00_EB*T**2 + 3.01689E+02_EB*T - 5.75359E+03_EB !J/kg/K
      H_L = -582454.333_EB !J/kg
      H_V = 212890.8484_EB !J/kg
      T_REF = 63.3_EB !K
      T_MELT = 63.3_EB !K
      T_BOIL = 77.35_EB !K
      DENSITY = 807._EB !kg/m^3
      MU = 0.000158_EB !N.s/m^2
      K = 0.139 !W/m/K
      BETA = 0.00753_EB !1/K
   CASE('NITROGEN DIOXIDE')
      T = MIN(340._EB,MAX(290._EB,REAL(I_TMP,EB)))
      CP = 3.16667E-02_EB*T**2 - 1.12464E+01_EB*T + 3.13744E+03_EB!J/kg/K
      H_L = -468208.9742!J/kg
      H_V = 517409.8052_EB !J/kg
      T_REF = 262._EB !K
      T_MELT = 262._EB !K
      T_BOIL = 294.15_EB !K
      DENSITY = 1448._EB !kg/m^3
      K = 0.121_EB !W/m/K
      MU = 0.042 !N.s/m^2
   CASE('NITROUS OXIDE')
      T = MIN(184.67_EB,MAX(182.29_EB,REAL(I_TMP,EB)))
      CP = 187.7_EB+8.5_EB*T !J/kg/K
      H_L = 1066925.823_EB !J/kg
      H_V = 376140._EB !J/kg
      T_REF = 182.29_EB !K
      T_MELT = 182.29_EB !K
      T_BOIL = 184.67_EB !K
      DENSITY = 1266._EB !kg/m^3
      K = 0.146_EB !W/m/K
      MU = 0.00045 !N.s/m^2
   CASE('OXYGEN')
      T = MIN(100._EB,MAX(60._EB,REAL(I_TMP,EB)))
      CP = 8.33333E-04_EB*T**3 - 1.42143E-01_EB*T**2 + 8.10952E+00_EB*T + 1.50911E+03_EB!J/kg/K
      H_L = -525984.1559_EB !J/kg
      H_V = 213000._EB !J/kg
      T_REF = 54.8_EB !K
      T_MELT = 54.8_EB !K
      T_BOIL = 90.19_EB !K
      DENSITY = 1140._EB !kg/m^3
      K = 0.151_EB !W/m/K
      MU = 0.000188 !N.s/m^2
      BETA = 0.00954_EB !1/K
   CASE('PROPANE')
      T = MIN(270._EB,MAX(90._EB,REAL(I_TMP,EB)))
      CP = 7.05233E-05_EB*T**3 - 2.26153E-02_EB*T**2 + 3.85475E+00_EB*T + 1.69008E+03_EB!J/kg/K
      H_L = -3378618.928_EB !J/kg
      H_V = 552422.9873 !J/kg
      T_REF = 86._EB !K
      T_MELT = 86._EB !K
      T_BOIL = 231.25_EB !K
      DENSITY = 590._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.129_EB !W/m/K
      MU = 0.000197_EB  !N.s/m^2
      BETA = 0.004_EB !1/K
   CASE('PROPYLENE')
      T = MIN(280._EB,MAX(90._EB,REAL(I_TMP,EB)))
      CP = -6.71250E-05_EB*T**3 + 5.75614E-02_EB*T**2 - 1.29825E+01_EB*T + 2.94746E+03_EB !J/kg/K
      H_L = -560981.1207_EB !J/kg
      H_V = 575811.5686_EB !J/kg
      T_REF = 88._EB !K
      T_MELT = 88._EB !K
      T_BOIL = 225.41_EB !K
      DENSITY = 609._EB !kg/m^3
      FUEL = .TRUE.
      MU = 0.00009_EB  !N.s/m^2
      BETA = 0.004_EB !1/K (propane)
   CASE('SULFUR DIOXIDE')
      CP = 1359.14286_EB !J/kg/K
      H_L = -5350342.759_EB !J/kg
      H_V = 389370._EB !J/kg
      T_REF = 197.15_EB !K
      T_MELT = 197.15_EB !K
      T_BOIL = 263.05_EB !K
      DENSITY = 1434._EB !kg/m^3
      MU = 0.000257_EB  !N.s/m^2
      K = 0.196_EB !W/m/K
      BETA = 0.00212_EB !1/K
   !CASE('SULFUR HEXAFLUORIDE') sublimation
   CASE('TOLUENE') !NASA/TP-2002-211556
      T = MIN(500.0007_EB,MAX(REAL(I_TMP,EB),178.15_EB))
      CP = -3713549.51_EB*T**(-2)+77725.2903_EB/T-631.226986_EB+2.724391982_EB*T-0.00610353508_EB*T**2+&
         0.0000070224219_EB*T**3-0.00000000311371568_EB*T**4
      CP = CP * 8314.472_EB / 92.13842_EB !J/kg/K
      H_L = -316731.375581857_EB !J/kg
      H_V = 491861.689063827_EB !J/kg
      T_REF = 178.1_EB !K
      T_MELT = 178.1_EB !K
      T_BOIL = 383.8_EB !K
      DENSITY = 867._EB !kg/m^3
      FUEL = .TRUE.
      K = 0.151_EB !W/m/K
      MU = 0.000550_EB  !N.s/m^2
      BETA = 0.00108_EB !1/K
   CASE('WATER VAPOR') !NASA/TP-2002-211556
      T = MIN(600.0007_EB,MAX(REAL(I_TMP,EB),273.15_EB))
      IF (T<373.1507_EB) THEN
         CP = 1326371304_EB*T**(-2)-24482953.88_EB/T+187942.8776_EB-767.899505_EB*T+1.761556813_EB*T**2 &
            -0.002151167128_EB*T**3+0.000001092570813_EB*T**4
      ELSE
         CP = 1263631001_EB*T**(-2)-16803802.49_EB/T+92782.3479_EB-272.237395_EB*T+0.447924376_EB*T**2 &
            -0.000391939743_EB*T**3+0.0000001425743266_EB*T**4
      ENDIF
      CP = CP * 8314.472_EB / 18.01528_EB !J/kg/K
      H_L = -17125669.7834391_EB !J/kg
      H_V = 2500792.3981106_EB !J/kg
      T_REF = 273.15_EB !K
      T_MELT = 273.15_EB !K
      T_BOIL = 373.15_EB !K
      DENSITY = 1000._EB !kg/m^3
      BETA = 0.000889_EB !1/K
      MU = 0.00089_EB !Ns/m^2
      K = 0.609 !W/m/K
   CASE('XENON') !JPCRD6
      CP = 340000._EB !J/kg/K
      H_L = -260129.3894_EB !J/kg
      H_V = 160023.7636_EB !J/kg
      T_REF = 165.01_EB !K
      T_MELT = 161.40_EB !K
      T_BOIL = 165.01_EB !K
      DENSITY = 2879.8_EB !kg/m^3 JPCRD 59
      BETA = 0.002372042_EB !1/K JPCRD 59
      MU = 0.0004727_EB !Ns/m^2 JPCRD 59
      K = 0.07165 !W/m/K JPCRD 59
   CASE DEFAULT
      CP = -1._EB
      H_L = -1._EB
      H_V = -1._EB
      T_REF = -1._EB
      DENSITY=-1._EB
      T_MELT = -1._EB
      T_BOIL = -1._EB
END SELECT

END SUBROUTINE JANAF_TABLE_LIQUID


SUBROUTINE GAS_PROPS(GAS_NAME,SIGMA,EPSOK,PR_GAS,MW,FORMULA,LISTED,ATOM_COUNTS,H_F,RADCAL_NAME)

! Molecular weight (g/mol) and Lennard-Jones properties
! Brodkey, R. and Hershey, H. Transport Phenomena: A Unified Approach. McGraw-Hill. 1988
! Heat of Formation (H_F) has units of kJ/mol (see NIST Webbook)
! Some species (O,H,OH,HO2,H2O2) LJ parameters were taken from Jasper and Miller, Combustion and Flame, Vol. 161, 2014.
USE GLOBAL_CONSTANTS, ONLY: PR, Y_CO2_INFTY,Y_O2_INFTY
REAL(EB) :: SIGMA,EPSOK,MW,SIGMAIN,EPSOKIN,MWIN,ATOM_COUNTS(118),H_F,H_FIN,PR_GAS,PR_GASIN
CHARACTER(LABEL_LENGTH) :: GAS_NAME,RADCAL_NAME
CHARACTER(FORMULA_LENGTH) :: FORMULA,FORMULAIN
LOGICAL, INTENT(OUT) :: LISTED

SIGMAIN = SIGMA
EPSOKIN = EPSOK
FORMULAIN = FORMULA
FORMULA = 'null'
MWIN = MW
MW = -1._EB
H_FIN = H_F
LISTED  = .TRUE.
ATOM_COUNTS = 0._EB
PR_GASIN = PR_GAS
PR_GAS = PR
GAS_NAME_SELECT: SELECT CASE(GAS_NAME)
   CASE('ACETONE') ! THE PROPERTIES OF GASES AND LIQUIDS 5th ed.
      SIGMA = 4.6_EB
      EPSOK = 560.2
      FORMULA = "C3H6O"
      H_F= -217.1496_EB ! NASA/TP-2002-211556
      PR_GAS = 0.87_EB ! Faghri&Zhang Transport Phenomena in Multiphase Systems
      IF (RADCAL_NAME=='null') RADCAL_NAME='MMA'
   CASE('ACETYLENE')
      SIGMA = 4.033_EB
      EPSOK = 231.8_EB
      FORMULA = 'C2H2'
      PR_GAS = 0.78 ! airliquide.com
      H_F = 228.2_EB ! NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='PROPYLENE'
   CASE('ACROLEIN') !Isopropanol as surrogate
      SIGMA = 4.549_EB
      EPSOK = 576.7_EB
      FORMULA = 'C3H4O'
      H_F = -272.8_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='MMA'
   CASE('LJ AIR')
      SIGMA = 3.711_EB
      EPSOK = 78.6_EB
      MW = 1._EB/(Y_O2_INFTY/31.9988_EB+Y_CO2_INFTY/44.0095_EB+(1._EB-Y_O2_INFTY-Y_CO2_INFTY)/28.0134_EB)
      FORMULA = 'Air'
      PR_GAS = 0.71 ! JPCRD 19(5)
      H_F = 0._EB !Computed in read.f90
   CASE('AMMONIA')
      SIGMA = 2.900_EB
      EPSOK = 558.3_EB
      FORMULA = 'NH3'
      PR_GAS = 0.87 ! Bergman, Lavine, Icropera, Dewitt Fundamentals of Heat and Mass Trasnfer 2011
      H_F = -45.94_EB ! NASA/TP-2002-211556
   CASE('ARGON')
      SIGMA = 3.42_EB
      EPSOK = 124.0_EB
      FORMULA = 'Ar'
      PR_GAS = 0.67 ! Hardy, Hylton, McKnight, ORNL Correlations for Thermal Flowmeters
      H_F = 0._EB
   CASE('BENZENE') !THE PROPERTIES OF GASES AND LIQUIDS 5th ed.
      SIGMA = 5.349_EB
      EPSOK = 412.3
      FORMULA = 'C6H6'
      PR_GAS = 1.5 ! Martinez, Termodinamica basica y aplicada, 1992
      H_F = 82.88_EB ! NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='TOLUENE'
   CASE('BUTANE')
      SIGMA = 4.687_EB
      EPSOK = 531.4_EB
      FORMULA = 'C4H10'
      PR_GAS = 0.83 ! airliquide.com
      H_F = -125.79_EB ! NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='PROPANE'
   CASE('CARBON DIOXIDE')
      SIGMA = 3.941_EB
      EPSOK = 195.2_EB
      FORMULA = 'CO2'
      H_F = -393.51_EB ! NASA/TP-2002-211556
      PR_GAS = 0.75_EB ! JPCRD 19(5)
      IF (RADCAL_NAME=='null') RADCAL_NAME='CARBON DIOXIDE'
   CASE('CARBON MONOXIDE')
      SIGMA = 3.690_EB
      EPSOK = 91.7_EB
      FORMULA = 'CO'
      H_F = -110.535196_EB ! NASA/TP-2002-211556
      PR_GAS = 0.73_EB ! JPCRD 19(5)
      IF (RADCAL_NAME=='null') RADCAL_NAME='CARBON MONOXIDE'
   CASE('CHLORINE')
      SIGMA = 4.217_EB
      EPSOK = 316.0_EB
      FORMULA = 'Cl2'
      PR_GAS = 0.75 ! airliquide.com
      H_F = 0._EB
   CASE('DODECANE') ! N-Heptane as surrogate
      SIGMA = 4.701_EB
      EPSOK = 205.78_EB
      FORMULA = 'C12H26'
      H_F = -187.8_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='N-HEPTANE'
   CASE('ETHANE')
      SIGMA = 4.443_EB
      EPSOK = 215.7_EB
      FORMULA = 'C2H6'
      PR_GAS = 0.84_EB ! Faghri&Zhang Transport Phenomena in Multiphase Systems
      H_F = -83.851544_EB ! NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='ETHANE'
   CASE('ETHANOL')
      SIGMA = 4.530_EB
      EPSOK = 362.6_EB
      FORMULA='C2H5OH'
      PR_GAS = 0.84_EB ! Faghri&Zhang Transport Phenomena in Multiphase Systems
      H_F = -234._EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='METHANOL'
   CASE('ETHYLENE')
      SIGMA = 4.163_EB
      EPSOK = 224.7_EB
      FORMULA = 'C2H4'
      PR_GAS = 0.83 ! airliquide.com
      H_F = 52.47_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='ETHYLENE'
   CASE('FORMALDEHYDE')!Methanol as surrogate
      SIGMA = 3.626_EB
      EPSOK = 481.8_EB
      FORMULA = 'CH2O'
      H_F = -115.90_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='METHANOL'
   CASE('HELIUM')
      SIGMA = 2.551_EB
      EPSOK = 10.22_EB
      FORMULA = 'He'
      PR_GAS = 0.68 ! Bergman, Lavine, Icropera, Dewitt Fundamentals of Heat and Mass Trasnfer 2011
      H_F = 0._EB
   CASE('HYDROGEN')
      SIGMA = 2.827_EB
      EPSOK = 59.7_EB
      FORMULA = 'H2'
      PR_GAS = 0.69 ! Bergman, Lavine, Icropera, Dewitt Fundamentals of Heat and Mass Trasnfer 2011
      H_F = 0._EB
   CASE('HYDROGEN ATOM')
      SIGMA = 2.31_EB
      EPSOK = 123.6_EB
      FORMULA = 'H'
      H_F = 217.998828_EB ! NASA/TP-2002-211556
   CASE('HYDROGEN BROMIDE')
      SIGMA = 3.353_EB
      EPSOK = 449._EB
      FORMULA = 'HBr'
      PR_GAS = 0.69 ! airliquide.com
      H_F = -36.29_EB ! NASA/TP-2002-211556
   CASE('HYDROGEN CHLORIDE')
      SIGMA = 3.339_EB
      EPSOK = 344.7_EB
      FORMULA = 'HCl'
      PR_GAS = 0.75 ! airliquide.com
      H_F = -92.31_EB ! NASA/TP-2002-211556
   CASE('HYDROGEN CYANIDE')
      SIGMA = 3.63_EB
      EPSOK = 569.1_EB
      FORMULA = 'HCN'
      H_F = 133.08246_EB ! NASA/TP-2002-211556
   CASE('HYDROGEN FLUORIDE')
      SIGMA = 3.148_EB
      EPSOK = 330._EB
      FORMULA = 'HF'
      PR_GAS = 0.71 ! airliquide.com
      H_F = -273.3_EB  ! NASA/TP-2002-211556
   CASE('HYDROGEN PEROXIDE')
      SIGMA = 3.02_EB
      EPSOK = 106.5_EB
      FORMULA = 'H2O2'
      H_F = -135.88_EB ! NASA/TP-2002-211556
   CASE('HYDROGEN SULFIDE')
      SIGMA = 3.623_EB
      EPSOK = 301.1_EB
      FORMULA = 'H2S'
      H_F = -20.6_EB ! NASA/TP-2002-211556
   CASE('HYDROXYL RADICAL')
      SIGMA = 2.66_EB
      EPSOK = 92.1_EB
      FORMULA = 'OH'
      H_F = 37.278206_EB ! NASA/TP-2002-211556
   CASE('HYDROPEROXY RADICAL')
      SIGMA = 3.02_EB
      EPSOK = 106.5_EB
      FORMULA = 'HO2'
      H_F = 12.02_EB ! NASA/TP-2002-211556
   CASE('ISOPROPANOL')
      SIGMA = 4.549_EB
      EPSOK = 576.7_EB
      FORMULA = 'C3H7OH'
      H_F = -272.8_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='METHANOL'
   CASE('METHANE')
      SIGMA = 3.758_EB
      EPSOK = 148.6_EB
      FORMULA = 'CH4'
      PR_GAS = 0.70_EB ! JPCRD 19(5)
      H_F = -74.873_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='METHANE'
   CASE('METHANOL')
      SIGMA = 3.626_EB
      EPSOK = 481.8_EB
      FORMULA = 'CH3OH'
      H_F = -205._EB
      PR_GAS = 0.95_EB ! Faghri&Zhang Transport Phenomena in Multiphase Systems
      IF (RADCAL_NAME=='null') RADCAL_NAME='METHANOL'
   CASE('N-DECANE')
      SIGMA = 5.233_EB
      EPSOK = 226.46_EB
      FORMULA = 'C10H22'
      H_F = -249.7_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='N-HEPTANE'
   CASE('N-HEPTANE')
      SIGMA = 4.701_EB
      EPSOK = 205.78_EB
      FORMULA = 'C7H16'
      H_F = -187.78_EB !NASA/TP-2002-211556
      PR_GAS = 0.83 ! Martinez, Termodinamica basica y aplicada, 1992
      IF (RADCAL_NAME=='null') RADCAL_NAME='N-HEPTANE'
   CASE('N-HEXANE')
      SIGMA = 5.949_EB
      EPSOK = 399.3_EB
      FORMULA = 'C6H14'
      H_F = -166.92_EB !NASA/TP-2002-211556
      PR_GAS = 0.79 ! Martinez, Termodinamica basica y aplicada, 1992
      IF (RADCAL_NAME=='null') RADCAL_NAME='N-HEPTANE'
   CASE('N-OCTANE')
      SIGMA = 4.892_EB
      EPSOK = 231.16_EB
      FORMULA = 'C8H18'
      H_F = -208.75_EB !NASA/TP-2002-211556
      PR_GAS = 0.64 ! Martinez, Termodinamica basica y aplicada, 1992
      IF (RADCAL_NAME=='null') RADCAL_NAME='N-HEPTANE'
   CASE('NITRIC OXIDE')
      SIGMA = 3.492_EB
      EPSOK = 116.7_EB
      FORMULA = 'NO'
      H_F = 91.27131_EB !NASA/TP-2002-211556
      PR_GAS = 0.74_EB ! JPCRD 19(5)
   CASE('NITROGEN')
      SIGMA = 3.798_EB
      EPSOK = 71.4_EB
      H_F = 0._EB
      FORMULA = 'N2'
      PR_GAS = 0.71_EB ! JPCRD 19(5)
   CASE('NITROGEN ATOM')
      SIGMA = 3.798_EB
      EPSOK = 71.4_EB
      H_F = 472.68_EB !NASA/TP-2002-211556
      FORMULA = 'N'
      PR_GAS = 0.71_EB ! JPCRD 19(5)
   CASE('NITROGEN DIOXIDE') !Paul, P. DRFM, SAND98-8203
      SIGMA = 3.922_EB
      EPSOK = 204.88_EB
      FORMULA = 'NO2'
      PR_GAS = 6.1 ! Martinez, Termodinamica basica y aplicada, 1992
      H_F = 34.193019_EB !NASA/TP-2002-211556
   CASE('NITROUS OXIDE')
      SIGMA = 3.828_EB
      EPSOK = 232.4_EB
      FORMULA = 'N2O'
      PR_GAS = 0.74_EB ! JPCRD 19(5)
      H_F = 81.6_EB !NASA/TP-2002-211556
   CASE('OXYGEN')
      SIGMA = 3.467_EB
      EPSOK = 106.7_EB
      FORMULA ='O2'
      H_F = 0._EB
      PR_GAS = 0.71_EB ! JPCRD 19(5)
   CASE('OXYGEN ATOM')
      SIGMA = 2.66_EB
      EPSOK = 92.1_EB
      FORMULA ='O'
      H_F = 249.175003_EB  !NASA/TP-2002-211556
   CASE('PROPANE')
      SIGMA = 5.118_EB
      EPSOK = 237.1_EB
      FORMULA = 'C3H8'
      PR_GAS = 0.80 ! airliquide.com
      H_F = -104.68_EB !NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='PROPANE'
   CASE('PROPYLENE')
      SIGMA = 4.678_EB
      EPSOK = 298.9_EB
      FORMULA = 'C3H6'
      PR_GAS = 0.82 ! airliquide.com
      H_F = 20._EB !NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='PROPYLENE'
   CASE('SOOT')
      SIGMA = 3.798_EB
      EPSOK = 71.4_EB
      FORMULA = 'C0.9H0.1'
      H_F = 0._EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='SOOT'
   CASE('SULFUR DIOXIDE')
      SIGMA = 4.112_EB
      EPSOK = 335.4_EB
      FORMULA = 'SO2'
      PR_GAS = 0.91 ! airliquide.com
      H_F = -296.81_EB !NASA/TP-2002-211556
   CASE('SULFUR HEXAFLUORIDE')
      SIGMA = 5.128_EB
      EPSOK = 222.1_EB
      FORMULA = 'SF6'
      PR_GAS = 0.77_EB ! JPCRD 19(5)
      H_F = -1219.4_EB !NASA/TP-2002-211556
   CASE('TOLUENE')
      SIGMA = 5.698_EB
      EPSOK = 480._EB !Estimated from BENZENE
      FORMULA = 'C6H5CH3'
      H_F = 50.17_EB !NASA/TP-2002-211556
      IF (RADCAL_NAME=='null') RADCAL_NAME='TOLUENE'
   CASE('WATER VAPOR')
      SIGMA = 2.641_EB
      EPSOK = 809.1_EB
      FORMULA = 'H2O'
      H_F = -241.826_EB
      PR_GAS = 1.0 ! Bergman, Lavine, Icropera, Dewitt Fundamentals of Heat and Mass Trasnfer 2011
      IF (RADCAL_NAME=='null') RADCAL_NAME='WATER VAPOR'
   CASE('XENON')
      SIGMA = 4.047_EB
      EPSOK = 231.0_EB
      FORMULA = 'Xe'
      H_F = 0.0_EB
      PR_GAS = 0.64_EB
      IF (RADCAL_NAME=='null') RADCAL_NAME='WATER VAPOR'
   CASE DEFAULT !Uses NITROGEN
      SIGMA = 3.798_EB
      EPSOK = 71.4_EB
      H_F = 0._EB
      MW = 28.01340_EB
      PR_GAS = 0.71_EB ! JPCRD 19(5)
      LISTED = .FALSE.
END SELECT GAS_NAME_SELECT

IF (SIGMAIN>0._EB) SIGMA = SIGMAIN
IF (EPSOKIN>0._EB) EPSOK = EPSOKIN
IF (PR_GASIN>0._EB) PR_GAS = PR_GASIN
IF (TRIM(FORMULAIN)/='null') FORMULA = FORMULAIN
IF (TRIM(FORMULA)/='null' .AND. TRIM(FORMULA)/='Air') CALL GET_FORMULA_WEIGHT(FORMULA,MW,ATOM_COUNTS)
IF (MWIN   >0._EB) MW = MWIN
H_F = H_F*1.E3  !kJ/mol -> J/mol
IF (H_FIN > -1.E21_EB) H_F = H_FIN

END SUBROUTINE GAS_PROPS

FUNCTION CHECK_PREDEFINED(GAS_NAME)
LOGICAL CHECK_PREDEFINED
CHARACTER(LABEL_LENGTH),INTENT(IN) :: GAS_NAME

CHECK_PREDEFINED = .TRUE.

SELECT CASE(GAS_NAME)
   CASE('ACETONE')
      RETURN
   CASE('ACETYLENE')
      RETURN
   CASE('ACROLEIN')
      RETURN
   CASE('LJ AIR')
      RETURN
   CASE('AMMONIA')
      RETURN
   CASE('ARGON')
      RETURN
   CASE('BENZENE')
      RETURN
   CASE('BUTANE')
      RETURN
   CASE('CARBON')
      RETURN
   CASE('CARBON DIOXIDE')
      RETURN
   CASE('CARBON MONOXIDE')
      RETURN
   CASE('CHLORINE')
      RETURN
   CASE('DODECANE')
      RETURN
   CASE('ETHANE')
      RETURN
   CASE('ETHANOL')
      RETURN
   CASE('ETHYLENE')
      RETURN
   CASE('FORMALDEHYDE')
      RETURN
   CASE('HELIUM')
      RETURN
   CASE('HYDROGEN')
      RETURN
   CASE('HYDROGEN ATOM')
      RETURN
   CASE('HYDROGEN BROMIDE')
      RETURN
   CASE('HYDROGEN CHLORIDE')
      RETURN
   CASE('HYDROGEN CYANIDE')
      RETURN
   CASE('HYDROGEN FLUORIDE')
      RETURN
   CASE('HYDROGEN PEROXIDE')
      RETURN
   CASE('HYDROGEN SULFIDE')
      RETURN
   CASE('HYDROPEROXY RADICAL')
      RETURN
   CASE('HYDROXYL RADICAL')
      RETURN
   CASE('ISOPROPANOL')
      RETURN
   CASE('METHANE')
      RETURN
   CASE('METHANOL')
      RETURN
   CASE('N-DECANE')
      RETURN
   CASE('N-HEPTANE')
      RETURN
   CASE('N-HEXANE')
      RETURN
   CASE('N-OCTANE')
      RETURN
   CASE('NITRIC OXIDE')
      RETURN
   CASE('NITROGEN ATOM')
      RETURN
   CASE('NITROGEN')
      RETURN
   CASE('NITROGEN DIOXIDE')
      RETURN
   CASE('NITROUS OXIDE')
      RETURN
   CASE('OXYGEN')
      RETURN
   CASE('OXYGEN ATOM')
      RETURN
   CASE('PROPANE')
      RETURN
   CASE('PROPYLENE')
      RETURN
   CASE('SOOT')
      RETURN
   CASE('SULFUR DIOXIDE')
      RETURN
   CASE('SULFUR HEXAFLUORIDE')
      RETURN
   CASE('TOLUENE')
      RETURN
   CASE('WATER VAPOR')
      RETURN
   CASE DEFAULT
      CHECK_PREDEFINED=.FALSE.
END SELECT

END FUNCTION CHECK_PREDEFINED

SUBROUTINE FED_PROPS(GAS_NAME,FLD_IRR,FIC_IRR)
! Lethal and incapacitating concentrations
! D.A. Purser, SFPE Handbook, 4th Ed.

REAL(EB),INTENT(INOUT):: FLD_IRR,FIC_IRR
REAL(EB) ::FLD_IRR_IN,FIC_IRR_IN
CHARACTER(LABEL_LENGTH) GAS_NAME

FLD_IRR_IN = FLD_IRR
FIC_IRR_IN = FIC_IRR

SELECT CASE(GAS_NAME)
   CASE('HYDROGEN BROMIDE')
      FLD_IRR=0.114000_EB
      FIC_IRR=0.000900_EB
   CASE('HYDROGEN CHLORIDE')
      FLD_IRR=0.114000_EB
      FIC_IRR=0.000900_EB
   CASE('HYDROGEN FLUORIDE')
      FLD_IRR=0.087000_EB
      FIC_IRR=0.000900_EB
   CASE('SULFUR DIOXIDE')
      FLD_IRR=0.012000_EB
      FIC_IRR=0.000120_EB
   CASE('NITROGEN DIOXIDE')
      FLD_IRR=0.001900_EB
      FIC_IRR=0.000350_EB
   CASE('ACROLEIN')
      FLD_IRR=0.004500_EB
      FIC_IRR=0.000020_EB
   CASE('FORMALDEHYDE')
      FLD_IRR=0.022500_EB
      FIC_IRR=0.000030_EB
   CASE DEFAULT
      FLD_IRR=0._EB
      FIC_IRR=0._EB
END SELECT

IF(FLD_IRR_IN > 0._EB) FLD_IRR = FLD_IRR_IN
IF(FIC_IRR_IN > 0._EB) FIC_IRR = FIC_IRR_IN

END SUBROUTINE FED_PROPS

SUBROUTINE CALC_GAS_PROPS(J,N,D_TMP,MU_TMP,K_TMP,CP_TMP,H_TMP,FUEL,G_F_TMP)
USE TYPES, ONLY:SPECIES_TYPE,SPECIES,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
USE GLOBAL_CONSTANTS, ONLY: R0
INTEGER,INTENT(IN) :: J,N
INTEGER :: I(1)
REAL(EB), INTENT(OUT) :: D_TMP,MU_TMP,K_TMP,CP_TMP,H_TMP,G_F_TMP
REAL(EB) :: SIGMA2,EPSIJ,AMW,TSTAR,OMEGA,TMP
LOGICAL, INTENT(INOUT) :: FUEL
TYPE(SPECIES_TYPE),POINTER :: SS=>NULL(),SS0=>NULL()

SS=>SPECIES(N)

TMP = REAL(J,EB)
IF (SS%D_USER>=0._EB) THEN
   D_TMP = SS%D_USER
ELSE
   I = MAXLOC(SPECIES_MIXTURE(1)%VOLUME_FRACTION)
   SS0=>SPECIES(I(1))
   SIGMA2 = (0.5_EB*(SS%SIG+SS0%SIG))**2
   EPSIJ  = SQRT(SS%EPSK*SS0%EPSK)
   AMW    = SQRT( (SS%MW+SS0%MW)/(2._EB*SS%MW*SS0%MW) )
   TSTAR = TMP/EPSIJ
   OMEGA = 1.06036_EB*TSTAR**(-0.15610_EB) + 0.19300_EB*EXP(-0.47635_EB*TSTAR) + 1.03587_EB*EXP(-1.52996_EB*TSTAR) &
         + 1.76474_EB*EXP(-3.89411_EB*TSTAR)
   D_TMP = 0.00266E-4_EB*AMW*TMP*SQRT(TMP)/(SIGMA2*OMEGA)
ENDIF

IF (SS%MU_USER>=0._EB) THEN
   MU_TMP = SS%MU_USER / SQRT(SS%MW)
ELSE
   SIGMA2 = SS%SIG**2
   TSTAR = TMP/SS%EPSK
   OMEGA = 1.16145_EB*TSTAR**(-0.14874_EB) +  0.52487_EB*EXP(-0.77320_EB*TSTAR) + 2.16178_EB*EXP(-2.43787_EB*TSTAR)
   MU_TMP = 26.69E-7_EB*SQRT(TMP)/(SIGMA2*OMEGA) ! SQRT(SS%MW) was in numerator Eq. 4-29
ENDIF

IF (SS%SPECIFIC_HEAT > 0._EB) THEN
   CP_TMP = SS%SPECIFIC_HEAT
ELSE
   CALL JANAF_TABLE(J,CP_TMP,H_TMP,SS%PROP_ID,SS%RCON,FUEL,G_F_TMP)
ENDIF

IF (SS%K_USER>=0._EB) THEN
   K_TMP = SS%K_USER / SQRT(SS%MW)
ELSE
   K_TMP = MU_TMP*CP_TMP/SS%PR_USER !MU_TMP divided by SQRT(SS%MW)
ENDIF

IF (SS%REFERENCE_ENTHALPY>-1.E20_EB) H_TMP = SS%REFERENCE_ENTHALPY

END SUBROUTINE CALC_GAS_PROPS


SUBROUTINE LOOKUP_CHI_R(FUEL,CHI_R)

! For a given FUEL, send back the radiative fraction

CHARACTER(LABEL_LENGTH),INTENT(IN) :: FUEL
REAL(EB), INTENT(OUT) :: CHI_R

SELECT CASE(FUEL)
   CASE('ACETONE')     ; CHI_R = 0.27_EB
   CASE('ACETYLENE')   ; CHI_R = 0.49_EB
   CASE('BENZENE')     ; CHI_R = 0.60_EB
   CASE('BUTANE')      ; CHI_R = 0.30_EB
   CASE('DODECANE')    ; CHI_R = 0.40_EB
   CASE('ETHANE')      ; CHI_R = 0.25_EB
   CASE('ETHANOL')     ; CHI_R = 0.25_EB
   CASE('ETHYLENE')    ; CHI_R = 0.25_EB
   CASE('HYDROGEN')    ; CHI_R = 0.20_EB
   CASE('ISOPROPANOL') ; CHI_R = 0.29_EB
   CASE('METHANE')     ; CHI_R = 0.20_EB
   CASE('METHANOL')    ; CHI_R = 0.16_EB
   CASE('N-DECANE')    ; CHI_R = 0.40_EB
   CASE('N-HEPTANE')   ; CHI_R = 0.40_EB
   CASE('N-HEXANE')    ; CHI_R = 0.40_EB
   CASE('N-OCTANE')    ; CHI_R = 0.40_EB
   CASE('PROPANE')     ; CHI_R = 0.30_EB
   CASE('PROPYLENE')   ; CHI_R = 0.37_EB
   CASE('TOLUENE')     ; CHI_R = 0.40_EB
   CASE DEFAULT        ; CHI_R = 0.35_EB
END SELECT

END SUBROUTINE LOOKUP_CHI_R


SUBROUTINE LOOKUP_CRITICAL_FLAME_TEMPERATURE(FUEL,CRITICAL_FLAME_TEMPERATURE)

! For a given FUEL, send back the Critical Flame Temperature in degrees C

CHARACTER(LABEL_LENGTH),INTENT(IN) :: FUEL
REAL(EB), INTENT(OUT) :: CRITICAL_FLAME_TEMPERATURE

SELECT CASE(FUEL)
   CASE('ACETONE')     ; CRITICAL_FLAME_TEMPERATURE = 1457._EB
   CASE('ACETYLENE')   ; CRITICAL_FLAME_TEMPERATURE = 1267._EB
   CASE('BENZENE')     ; CRITICAL_FLAME_TEMPERATURE = 1537._EB
   CASE('BUTANE')      ; CRITICAL_FLAME_TEMPERATURE = 1557._EB
   CASE('ETHANE')      ; CRITICAL_FLAME_TEMPERATURE = 1357._EB
   CASE('ETHANOL')     ; CRITICAL_FLAME_TEMPERATURE = 1397._EB
   CASE('ETHYLENE')    ; CRITICAL_FLAME_TEMPERATURE = 1337._EB
   CASE('HYDROGEN')    ; CRITICAL_FLAME_TEMPERATURE =  807._EB
   CASE('ISOPROPANOL') ; CRITICAL_FLAME_TEMPERATURE = 1427._EB
   CASE('METHANE')     ; CRITICAL_FLAME_TEMPERATURE = 1507._EB
   CASE('METHANOL')    ; CRITICAL_FLAME_TEMPERATURE = 1257._EB
   CASE('N-DECANE')    ; CRITICAL_FLAME_TEMPERATURE = 1507._EB
   CASE('N-HEPTANE')   ; CRITICAL_FLAME_TEMPERATURE = 1497._EB
   CASE('N-HEXANE')    ; CRITICAL_FLAME_TEMPERATURE = 1497._EB
   CASE('N-OCTANE')    ; CRITICAL_FLAME_TEMPERATURE = 1507._EB
   CASE('PROPANE')     ; CRITICAL_FLAME_TEMPERATURE = 1447._EB
   CASE DEFAULT        ; CRITICAL_FLAME_TEMPERATURE = 1427._EB
END SELECT

END SUBROUTINE LOOKUP_CRITICAL_FLAME_TEMPERATURE


SUBROUTINE LOOKUP_LOWER_OXYGEN_LIMIT(FUEL,LOWER_OXYGEN_LIMIT)

! For a given FUEL, return the Lower Oxygen Limit as a volume fraction

CHARACTER(LABEL_LENGTH),INTENT(IN) :: FUEL
REAL(EB), INTENT(OUT) :: LOWER_OXYGEN_LIMIT

SELECT CASE(FUEL)
   CASE('ACETONE')     ; LOWER_OXYGEN_LIMIT = 0.129_EB
   CASE('ACETYLENE')   ; LOWER_OXYGEN_LIMIT = 0.085_EB
   CASE('BENZENE')     ; LOWER_OXYGEN_LIMIT = 0.133_EB
   CASE('BUTANE')      ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('ETHANE')      ; LOWER_OXYGEN_LIMIT = 0.118_EB
   CASE('ETHANOL')     ; LOWER_OXYGEN_LIMIT = 0.126_EB
   CASE('ETHYLENE')    ; LOWER_OXYGEN_LIMIT = 0.105_EB
   CASE('HYDROGEN')    ; LOWER_OXYGEN_LIMIT = 0.054_EB
   CASE('ISOPROPANOL') ; LOWER_OXYGEN_LIMIT = 0.128_EB
   CASE('METHANE')     ; LOWER_OXYGEN_LIMIT = 0.139_EB
   CASE('METHANOL')    ; LOWER_OXYGEN_LIMIT = 0.111_EB
   CASE('N-DECANE')    ; LOWER_OXYGEN_LIMIT = 0.135_EB
   CASE('N-HEPTANE')   ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('N-HEXANE')    ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('N-OCTANE')    ; LOWER_OXYGEN_LIMIT = 0.134_EB
   CASE('PROPANE')     ; LOWER_OXYGEN_LIMIT = 0.127_EB
   CASE DEFAULT        ; LOWER_OXYGEN_LIMIT = 0.135_EB
END SELECT

END SUBROUTINE LOOKUP_LOWER_OXYGEN_LIMIT


SUBROUTINE CALC_MIX_PROPS(J,D_TMP,MU_TMP,K_TMP,CP_TMP,H_TMP,EPSK,SIG,D_USER,MU_USER,K_USER,MW,CP_USER,REF_USER, &
                          REF_TMP_USER,PR_USER)
USE TYPES, ONLY:SPECIES_TYPE,SPECIES,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
USE GLOBAL_CONSTANTS, ONLY: PR
INTEGER,INTENT(IN) :: J
INTEGER :: I(1)
REAL(EB), INTENT(IN) :: EPSK,SIG,D_USER,MU_USER,K_USER,MW,CP_USER,REF_USER,REF_TMP_USER,PR_USER
REAL(EB), INTENT(INOUT) :: D_TMP,MU_TMP,K_TMP,CP_TMP,H_TMP
REAL(EB) :: SIGMA2,EPSIJ,AMW,TSTAR,OMEGA,TMP,PR_TMP
TYPE(SPECIES_TYPE),POINTER :: SS0=>NULL()

TMP = REAL(J,EB)
IF (SIG > 0._EB .AND. EPSK > 0._EB) THEN
   I = MAXLOC(SPECIES_MIXTURE(1)%VOLUME_FRACTION)
   SS0=>SPECIES(I(1))
   SIGMA2 = (0.5_EB*(SIG+SS0%SIG))**2
   EPSIJ  = SQRT(EPSK*SS0%EPSK)
   AMW    = SQRT( (MW+SS0%MW)/(2._EB*MW*SS0%MW) )
   TSTAR = TMP/EPSIJ
   OMEGA = 1.06036_EB*TSTAR**(-0.15610_EB) + 0.19300_EB*EXP(-0.47635_EB*TSTAR) + 1.03587_EB*EXP(-1.52996_EB*TSTAR) &
         + 1.76474_EB*EXP(-3.89411_EB*TSTAR)
   D_TMP = 0.00266E-4_EB*AMW*TMP*SQRT(TMP)/(SIGMA2*OMEGA)
   SIGMA2 = SIG**2
   TSTAR = TMP/EPSK
   OMEGA = 1.16145_EB*TSTAR**(-0.14874_EB) +  0.52487_EB*EXP(-0.77320_EB*TSTAR) + 2.16178_EB*EXP(-2.43787_EB*TSTAR)
   MU_TMP = 26.69E-7_EB*SQRT(TMP)/(SIGMA2*OMEGA)
ENDIF
IF (D_USER>=0._EB) D_TMP = D_USER
IF (MU_USER>=0._EB) MU_TMP = MU_USER / SQRT(MW)
IF (CP_USER > 0._EB) CP_TMP = CP_USER
PR_TMP = PR
IF (PR_USER > 0._EB) PR_TMP = PR_USER
IF (REF_USER > 0._EB) H_TMP = REF_USER - CP_TMP * REF_TMP_USER
IF (SIG > 0._EB .AND. EPSK > 0._EB) K_TMP = MU_TMP*CP_TMP/PR_TMP
IF (K_USER>=0._EB) K_TMP = K_USER/SQRT(MW)

END SUBROUTINE CALC_MIX_PROPS

SUBROUTINE MAKE_PERIODIC_TABLE

ELEMENT(1)%ABBREVIATION='H'; ELEMENT(1)%NAME='HYDROGEN'; ELEMENT(1)%MASS=1.00794_EB
ELEMENT(2)%ABBREVIATION='He'; ELEMENT(2)%NAME='HELIUM'; ELEMENT(2)%MASS=4.002602_EB
ELEMENT(3)%ABBREVIATION='Li'; ELEMENT(3)%NAME='LITHIUM'; ELEMENT(3)%MASS=6.941_EB
ELEMENT(4)%ABBREVIATION='Be'; ELEMENT(4)%NAME='BERYLLIUM'; ELEMENT(4)%MASS=9.012182_EB
ELEMENT(5)%ABBREVIATION='B'; ELEMENT(5)%NAME='BORON'; ELEMENT(5)%MASS=10.811_EB
ELEMENT(6)%ABBREVIATION='C'; ELEMENT(6)%NAME='CARBON'; ELEMENT(6)%MASS=12.0107_EB
ELEMENT(7)%ABBREVIATION='N'; ELEMENT(7)%NAME='NITROGEN'; ELEMENT(7)%MASS=14.0067_EB
ELEMENT(8)%ABBREVIATION='O'; ELEMENT(8)%NAME='OXYGEN'; ELEMENT(8)%MASS=15.9994_EB
ELEMENT(9)%ABBREVIATION='F'; ELEMENT(9)%NAME='FLUORINE'; ELEMENT(9)%MASS=18.9984032_EB
ELEMENT(10)%ABBREVIATION='Ne'; ELEMENT(10)%NAME='NEON'; ELEMENT(10)%MASS=20.1797_EB
ELEMENT(11)%ABBREVIATION='Na'; ELEMENT(11)%NAME='SODIUM'; ELEMENT(11)%MASS=22.98976928_EB
ELEMENT(12)%ABBREVIATION='Mg'; ELEMENT(12)%NAME='MAGNESIUM'; ELEMENT(12)%MASS=24.305_EB
ELEMENT(13)%ABBREVIATION='Al'; ELEMENT(13)%NAME='ALUMINIUM'; ELEMENT(13)%MASS=26.9815386_EB
ELEMENT(14)%ABBREVIATION='Si'; ELEMENT(14)%NAME='SILICON'; ELEMENT(14)%MASS=28.0855_EB
ELEMENT(15)%ABBREVIATION='P'; ELEMENT(15)%NAME='PHOSPHORUS'; ELEMENT(15)%MASS=30.973762_EB
ELEMENT(16)%ABBREVIATION='S'; ELEMENT(16)%NAME='SULFUR'; ELEMENT(16)%MASS=32.065_EB
ELEMENT(17)%ABBREVIATION='Cl'; ELEMENT(17)%NAME='CHLORINE'; ELEMENT(17)%MASS=35.453_EB
ELEMENT(18)%ABBREVIATION='Ar'; ELEMENT(18)%NAME='ARGON'; ELEMENT(18)%MASS=39.948_EB
ELEMENT(19)%ABBREVIATION='K'; ELEMENT(19)%NAME='POTASSIUM'; ELEMENT(19)%MASS=39.0983_EB
ELEMENT(20)%ABBREVIATION='Ca'; ELEMENT(20)%NAME='CALCIUM'; ELEMENT(20)%MASS=40.078_EB
ELEMENT(21)%ABBREVIATION='Sc'; ELEMENT(21)%NAME='SCANDIUM'; ELEMENT(21)%MASS=44.955912_EB
ELEMENT(22)%ABBREVIATION='Ti'; ELEMENT(22)%NAME='TITANIUM'; ELEMENT(22)%MASS=47.867_EB
ELEMENT(23)%ABBREVIATION='V'; ELEMENT(23)%NAME='VANADIUM'; ELEMENT(23)%MASS=50.9415_EB
ELEMENT(24)%ABBREVIATION='Cr'; ELEMENT(24)%NAME='CHROMIUM'; ELEMENT(24)%MASS=51.9961_EB
ELEMENT(25)%ABBREVIATION='Mn'; ELEMENT(25)%NAME='MANGANESE'; ELEMENT(25)%MASS=54.938045_EB
ELEMENT(26)%ABBREVIATION='Fe'; ELEMENT(26)%NAME='IRON'; ELEMENT(26)%MASS=55.845_EB
ELEMENT(27)%ABBREVIATION='Co'; ELEMENT(27)%NAME='COBALT'; ELEMENT(27)%MASS=58.933195_EB
ELEMENT(28)%ABBREVIATION='Ni'; ELEMENT(28)%NAME='NICKEL'; ELEMENT(28)%MASS=58.6934_EB
ELEMENT(29)%ABBREVIATION='Cu'; ELEMENT(29)%NAME='COPPER'; ELEMENT(29)%MASS=63.546_EB
ELEMENT(30)%ABBREVIATION='Zn'; ELEMENT(30)%NAME='ZINC'; ELEMENT(30)%MASS=65.38_EB
ELEMENT(31)%ABBREVIATION='Ga'; ELEMENT(31)%NAME='GALLIUM'; ELEMENT(31)%MASS=69.723_EB
ELEMENT(32)%ABBREVIATION='Ge'; ELEMENT(32)%NAME='GERMANIUM'; ELEMENT(32)%MASS=72.64_EB
ELEMENT(33)%ABBREVIATION='As'; ELEMENT(33)%NAME='ARSENIC'; ELEMENT(33)%MASS=74.9216_EB
ELEMENT(34)%ABBREVIATION='Se'; ELEMENT(34)%NAME='SELENIUM'; ELEMENT(34)%MASS=78.96_EB
ELEMENT(35)%ABBREVIATION='Br'; ELEMENT(35)%NAME='BROMINE'; ELEMENT(35)%MASS=79.904_EB
ELEMENT(36)%ABBREVIATION='Kr'; ELEMENT(36)%NAME='KRYPTON'; ELEMENT(36)%MASS=83.798_EB
ELEMENT(37)%ABBREVIATION='Rb'; ELEMENT(37)%NAME='RUBIDIUM'; ELEMENT(37)%MASS=85.4678_EB
ELEMENT(38)%ABBREVIATION='Sr'; ELEMENT(38)%NAME='STRONTIUM'; ELEMENT(38)%MASS=87.62_EB
ELEMENT(39)%ABBREVIATION='Y'; ELEMENT(39)%NAME='YTTRIUM'; ELEMENT(39)%MASS=88.90585_EB
ELEMENT(40)%ABBREVIATION='Zr'; ELEMENT(40)%NAME='ZIRCONIUM'; ELEMENT(40)%MASS=91.224_EB
ELEMENT(41)%ABBREVIATION='Nb'; ELEMENT(41)%NAME='NIOBIUM'; ELEMENT(41)%MASS=92.90638_EB
ELEMENT(42)%ABBREVIATION='Mo'; ELEMENT(42)%NAME='MOLYBDENUM'; ELEMENT(42)%MASS=95.96_EB
ELEMENT(43)%ABBREVIATION='Tc'; ELEMENT(43)%NAME='TECHNETIUM'; ELEMENT(43)%MASS=98_EB
ELEMENT(44)%ABBREVIATION='Ru'; ELEMENT(44)%NAME='RUTHENIUM'; ELEMENT(44)%MASS=101.07_EB
ELEMENT(45)%ABBREVIATION='Rh'; ELEMENT(45)%NAME='RHODIUM'; ELEMENT(45)%MASS=102.9055_EB
ELEMENT(46)%ABBREVIATION='Pd'; ELEMENT(46)%NAME='PALLADIUM'; ELEMENT(46)%MASS=106.42_EB
ELEMENT(47)%ABBREVIATION='Ag'; ELEMENT(47)%NAME='SILVER'; ELEMENT(47)%MASS=107.8682_EB
ELEMENT(48)%ABBREVIATION='Cd'; ELEMENT(48)%NAME='CADMIUM'; ELEMENT(48)%MASS=112.411_EB
ELEMENT(49)%ABBREVIATION='In'; ELEMENT(49)%NAME='INDIUM'; ELEMENT(49)%MASS=114.818_EB
ELEMENT(50)%ABBREVIATION='Sn'; ELEMENT(50)%NAME='TIN'; ELEMENT(50)%MASS=118.71_EB
ELEMENT(51)%ABBREVIATION='Sb'; ELEMENT(51)%NAME='ANTIMONY'; ELEMENT(51)%MASS=121.76_EB
ELEMENT(52)%ABBREVIATION='Te'; ELEMENT(52)%NAME='TELLURIUM'; ELEMENT(52)%MASS=127.6_EB
ELEMENT(53)%ABBREVIATION='I'; ELEMENT(53)%NAME='IODINE'; ELEMENT(53)%MASS=126.90447_EB
ELEMENT(54)%ABBREVIATION='Xe'; ELEMENT(54)%NAME='XENON'; ELEMENT(54)%MASS=131.293_EB
ELEMENT(55)%ABBREVIATION='Cs'; ELEMENT(55)%NAME='CAESIUM'; ELEMENT(55)%MASS=132.9054519_EB
ELEMENT(56)%ABBREVIATION='Ba'; ELEMENT(56)%NAME='BARIUM'; ELEMENT(56)%MASS=137.327_EB
ELEMENT(57)%ABBREVIATION='La'; ELEMENT(57)%NAME='LANTHANUM'; ELEMENT(57)%MASS=138.90547_EB
ELEMENT(58)%ABBREVIATION='Ce'; ELEMENT(58)%NAME='CERIUM'; ELEMENT(58)%MASS=140.116_EB
ELEMENT(59)%ABBREVIATION='Pr'; ELEMENT(59)%NAME='PRASEODYMIUM'; ELEMENT(59)%MASS=140.90765_EB
ELEMENT(60)%ABBREVIATION='Nd'; ELEMENT(60)%NAME='NEODYMIUM'; ELEMENT(60)%MASS=144.242_EB
ELEMENT(61)%ABBREVIATION='Pm'; ELEMENT(61)%NAME='PROMETHIUM'; ELEMENT(61)%MASS=145_EB
ELEMENT(62)%ABBREVIATION='Sm'; ELEMENT(62)%NAME='SAMARIUM'; ELEMENT(62)%MASS=150.36_EB
ELEMENT(63)%ABBREVIATION='Eu'; ELEMENT(63)%NAME='EUROPIUM'; ELEMENT(63)%MASS=151.964_EB
ELEMENT(64)%ABBREVIATION='Gd'; ELEMENT(64)%NAME='GADOLINIUM'; ELEMENT(64)%MASS=157.25_EB
ELEMENT(65)%ABBREVIATION='Tb'; ELEMENT(65)%NAME='TERBIUM'; ELEMENT(65)%MASS=158.92535_EB
ELEMENT(66)%ABBREVIATION='Dy'; ELEMENT(66)%NAME='DYSPROSIUM'; ELEMENT(66)%MASS=162.5_EB
ELEMENT(67)%ABBREVIATION='Ho'; ELEMENT(67)%NAME='HOLMIUM'; ELEMENT(67)%MASS=164.93032_EB
ELEMENT(68)%ABBREVIATION='Er'; ELEMENT(68)%NAME='ERBIUM'; ELEMENT(68)%MASS=167.259_EB
ELEMENT(69)%ABBREVIATION='Tm'; ELEMENT(69)%NAME='THULIUM'; ELEMENT(69)%MASS=168.93421_EB
ELEMENT(70)%ABBREVIATION='Yb'; ELEMENT(70)%NAME='YTTERBIUM'; ELEMENT(70)%MASS=173.054_EB
ELEMENT(71)%ABBREVIATION='Lu'; ELEMENT(71)%NAME='LUTETIUM'; ELEMENT(71)%MASS=174.9668_EB
ELEMENT(72)%ABBREVIATION='Hf'; ELEMENT(72)%NAME='HAFNIUM'; ELEMENT(72)%MASS=178.49_EB
ELEMENT(73)%ABBREVIATION='Ta'; ELEMENT(73)%NAME='TANTALUM'; ELEMENT(73)%MASS=180.94788_EB
ELEMENT(74)%ABBREVIATION='W'; ELEMENT(74)%NAME='TUNGSTEN'; ELEMENT(74)%MASS=183.84_EB
ELEMENT(75)%ABBREVIATION='Re'; ELEMENT(75)%NAME='RHENIUM'; ELEMENT(75)%MASS=186.207_EB
ELEMENT(76)%ABBREVIATION='Os'; ELEMENT(76)%NAME='OSMIUM'; ELEMENT(76)%MASS=190.23_EB
ELEMENT(77)%ABBREVIATION='Ir'; ELEMENT(77)%NAME='IRIDIUM'; ELEMENT(77)%MASS=192.217_EB
ELEMENT(78)%ABBREVIATION='Pt'; ELEMENT(78)%NAME='PLATINUM'; ELEMENT(78)%MASS=195.084_EB
ELEMENT(79)%ABBREVIATION='Au'; ELEMENT(79)%NAME='GOLD'; ELEMENT(79)%MASS=196.966569_EB
ELEMENT(80)%ABBREVIATION='Hg'; ELEMENT(80)%NAME='MERCURY'; ELEMENT(80)%MASS=200.59_EB
ELEMENT(81)%ABBREVIATION='Tl'; ELEMENT(81)%NAME='THALLIUM'; ELEMENT(81)%MASS=204.3833_EB
ELEMENT(82)%ABBREVIATION='Pb'; ELEMENT(82)%NAME='LEAD'; ELEMENT(82)%MASS=207.2_EB
ELEMENT(83)%ABBREVIATION='Bi'; ELEMENT(83)%NAME='BISMUTH'; ELEMENT(83)%MASS=208.9804_EB
ELEMENT(84)%ABBREVIATION='Po'; ELEMENT(84)%NAME='POLONIUM'; ELEMENT(84)%MASS=210_EB
ELEMENT(85)%ABBREVIATION='At'; ELEMENT(85)%NAME='ASTATINE'; ELEMENT(85)%MASS=210_EB
ELEMENT(86)%ABBREVIATION='Rn'; ELEMENT(86)%NAME='RADON'; ELEMENT(86)%MASS=222_EB
ELEMENT(87)%ABBREVIATION='Fr'; ELEMENT(87)%NAME='FRANCIUM'; ELEMENT(87)%MASS=223_EB
ELEMENT(88)%ABBREVIATION='Ra'; ELEMENT(88)%NAME='RADIUM'; ELEMENT(88)%MASS=226_EB
ELEMENT(89)%ABBREVIATION='Ac'; ELEMENT(89)%NAME='ACTINIUM'; ELEMENT(89)%MASS=227_EB
ELEMENT(90)%ABBREVIATION='Th'; ELEMENT(90)%NAME='THORIUM'; ELEMENT(90)%MASS=232.03806_EB
ELEMENT(91)%ABBREVIATION='Pa'; ELEMENT(91)%NAME='PROTACTINIUM'; ELEMENT(91)%MASS=231.03588_EB
ELEMENT(92)%ABBREVIATION='U'; ELEMENT(92)%NAME='URANIUM'; ELEMENT(92)%MASS=238.02891_EB
ELEMENT(93)%ABBREVIATION='Np'; ELEMENT(93)%NAME='NEPTUNIUM'; ELEMENT(93)%MASS=237_EB
ELEMENT(94)%ABBREVIATION='Pu'; ELEMENT(94)%NAME='PLUTONIUM'; ELEMENT(94)%MASS=244_EB
ELEMENT(95)%ABBREVIATION='Am'; ELEMENT(95)%NAME='AMERICIUM'; ELEMENT(95)%MASS=243_EB
ELEMENT(96)%ABBREVIATION='Cm'; ELEMENT(96)%NAME='CURIUM'; ELEMENT(96)%MASS=247_EB
ELEMENT(97)%ABBREVIATION='Bk'; ELEMENT(97)%NAME='BERKELIUM'; ELEMENT(97)%MASS=247_EB
ELEMENT(98)%ABBREVIATION='Cf'; ELEMENT(98)%NAME='CALIFORNIUM'; ELEMENT(98)%MASS=251_EB
ELEMENT(99)%ABBREVIATION='Es'; ELEMENT(99)%NAME='EINSTEINIUM'; ELEMENT(99)%MASS=252_EB
ELEMENT(100)%ABBREVIATION='Fm'; ELEMENT(100)%NAME='FERMIUM'; ELEMENT(100)%MASS=257_EB
ELEMENT(101)%ABBREVIATION='Md'; ELEMENT(101)%NAME='MENDELEVIUM'; ELEMENT(101)%MASS=258_EB
ELEMENT(102)%ABBREVIATION='No'; ELEMENT(102)%NAME='NOBELIUM'; ELEMENT(102)%MASS=259_EB
ELEMENT(103)%ABBREVIATION='Lr'; ELEMENT(103)%NAME='LAWRENCIUM'; ELEMENT(103)%MASS=262_EB
ELEMENT(104)%ABBREVIATION='Rf'; ELEMENT(104)%NAME='RUTHERFORDIUM'; ELEMENT(104)%MASS=261_EB
ELEMENT(105)%ABBREVIATION='Db'; ELEMENT(105)%NAME='DUBNIUM'; ELEMENT(105)%MASS=262_EB
ELEMENT(106)%ABBREVIATION='Sg'; ELEMENT(106)%NAME='SEABORGIUM'; ELEMENT(106)%MASS=266_EB
ELEMENT(107)%ABBREVIATION='Bh'; ELEMENT(107)%NAME='BOHRIUM'; ELEMENT(107)%MASS=264_EB
ELEMENT(108)%ABBREVIATION='Hs'; ELEMENT(108)%NAME='HASSIUM'; ELEMENT(108)%MASS=267_EB
ELEMENT(109)%ABBREVIATION='Mt'; ELEMENT(109)%NAME='MEITNERIUM'; ELEMENT(109)%MASS=268_EB
ELEMENT(110)%ABBREVIATION='Ds'; ELEMENT(110)%NAME='DARMSTADTIUM'; ELEMENT(110)%MASS=271_EB
ELEMENT(111)%ABBREVIATION='Rg'; ELEMENT(111)%NAME='ROENTGENIUM'; ELEMENT(111)%MASS=282_EB
ELEMENT(112)%ABBREVIATION='Cn'; ELEMENT(112)%NAME='COPERNICIUM'; ELEMENT(112)%MASS=285_EB
ELEMENT(113)%ABBREVIATION='Uut'; ELEMENT(113)%NAME='UNUNTRIUM'; ELEMENT(113)%MASS=284_EB
ELEMENT(114)%ABBREVIATION='Uuq'; ELEMENT(114)%NAME='UNUNQUADIUM'; ELEMENT(114)%MASS=289_EB
ELEMENT(115)%ABBREVIATION='Uup'; ELEMENT(115)%NAME='UNUNPENTIUM'; ELEMENT(115)%MASS=288_EB
ELEMENT(116)%ABBREVIATION='Uuh'; ELEMENT(116)%NAME='UNUNHEXIUM'; ELEMENT(116)%MASS=292_EB
ELEMENT(117)%ABBREVIATION='Uus'; ELEMENT(117)%NAME='UNUNSEPTIUM'; ELEMENT(117)%MASS=295_EB
ELEMENT(118)%ABBREVIATION='Uuo'; ELEMENT(118)%NAME='UNUNOCTIUM'; ELEMENT(118)%MASS=294_EB

END SUBROUTINE MAKE_PERIODIC_TABLE


SUBROUTINE SIMPLE_SPECIES_MW
USE GLOBAL_CONSTANTS,ONLY:MW_N2,MW_O2,MW_CO2,MW_H2O,MW_CO,MW_H2
REAL(EB)::ATOM_COUNTS(118)
CHARACTER(FORMULA_LENGTH)::FORMULA

FORMULA='N2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_N2,ATOM_COUNTS)
FORMULA='O2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_O2,ATOM_COUNTS)
FORMULA='CO2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_CO2,ATOM_COUNTS)
FORMULA='H2O'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_H2O,ATOM_COUNTS)
FORMULA='CO'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_CO,ATOM_COUNTS)
FORMULA='H2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_H2,ATOM_COUNTS)

END SUBROUTINE SIMPLE_SPECIES_MW


RECURSIVE SUBROUTINE GET_FORMULA_WEIGHT(FORMULA,WEIGHT_SUM,ATOM_COUNTS)
USE GLOBAL_CONSTANTS,ONLY:LU_ERR

CHARACTER(3) :: ELEMENT_NAME
CHARACTER(FORMULA_LENGTH), INTENT(IN) :: FORMULA
CHARACTER(FORMULA_LENGTH) :: SUBFORMULA
REAL(EB),INTENT(INOUT)::WEIGHT_SUM
REAL(EB),INTENT(INOUT)::ATOM_COUNTS(118)
REAL(EB)::SUB_WEIGHT,NUM
INTEGER :: I,J,LEN1,ELEMENT_INDEX
REAL(EB):: SUBATOM_COUNTS(118)

ATOM_COUNTS = 0._EB
WEIGHT_SUM = 0._EB
LEN1 = LEN(TRIM(FORMULA))
I=1

DO WHILE (I <= LEN1)
   SUBUNIT_SEARCH: IF(ICHAR(FORMULA(I:I))==IACHAR('(')) THEN
      SUBFORMULA=''
      FIND_RIGHT: DO J=I,LEN1
         IF(ICHAR(FORMULA(J:J))==IACHAR(')')) THEN
            WRITE(SUBFORMULA,'(A)') FORMULA(I+1:J-1)
            EXIT FIND_RIGHT
         ENDIF
      ENDDO FIND_RIGHT
      SUB_WEIGHT=0.
      SUBATOM_COUNTS=0._EB
      CALL GET_FORMULA_WEIGHT(SUBFORMULA,SUB_WEIGHT,SUBATOM_COUNTS)
      J=J+1
      CALL GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
      WEIGHT_SUM = WEIGHT_SUM + SUB_WEIGHT*NUM
      ATOM_COUNTS=ATOM_COUNTS+SUBATOM_COUNTS*NUM
      I=J
   ELSE SUBUNIT_SEARCH
      ELEMENT_NAME = '   '
      IF(IACHAR(FORMULA(I+1:I+1))<=IACHAR('z') .AND. IACHAR(FORMULA(I+1:I+1))>=IACHAR('a')) THEN
         IF(IACHAR(FORMULA(I+2:I+2))<=IACHAR('z') .AND. IACHAR(FORMULA(I+2:I+2))>=IACHAR('a')) THEN
            WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I+2)
            I=I+3
         ELSE
            WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I+1)
            I=I+2
         ENDIF
      ELSE
         WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I)
         I=I+1
      ENDIF
      ELEMENT_INDEX = -1
      ELEMENT_SEARCH: DO J=1,118
         IF(TRIM(ELEMENT_NAME)==TRIM(ELEMENT(J)%ABBREVIATION)) THEN
            ELEMENT_INDEX = J
            EXIT ELEMENT_SEARCH
         ENDIF
      ENDDO ELEMENT_SEARCH
      IF (ELEMENT_INDEX<0) THEN
         WRITE(LU_ERR,'(/A,A,A,A,A)') 'ERROR: Element named ',TRIM(ELEMENT_NAME),' in FORUMLA ',TRIM(FORMULA), ' is not found.'
         STOP
      ENDIF
      J=I
      CALL GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
      WEIGHT_SUM=WEIGHT_SUM+ELEMENT(ELEMENT_INDEX)%MASS*NUM
      ATOM_COUNTS(ELEMENT_INDEX)=ATOM_COUNTS(ELEMENT_INDEX)+NUM
      I=J
   ENDIF SUBUNIT_SEARCH
ENDDO

END SUBROUTINE GET_FORMULA_WEIGHT

SUBROUTINE GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
USE GLOBAL_CONSTANTS,ONLY:LU_ERR
CHARACTER(FORMULA_LENGTH), INTENT(IN) :: FORMULA
INTEGER,INTENT(IN):: LEN1
INTEGER,INTENT(INOUT)::J
INTEGER::I,K
REAL(EB),INTENT(OUT)::NUM

NUM=-1._EB
IF (J>LEN1) THEN
   NUM=1._EB
   RETURN
ENDIF
DO I=J,LEN1
   IF((IACHAR(FORMULA(I:I))>=IACHAR('A') .AND. IACHAR(FORMULA(I:I))<=IACHAR('Z')).OR.IACHAR(FORMULA(I:I))==IACHAR('(')) THEN
      IF (I==J) NUM=1.
      EXIT
   ELSEIF((IACHAR(FORMULA(I:I))<IACHAR('0') .OR. IACHAR(FORMULA(I:I))>IACHAR('9')).AND.IACHAR(FORMULA(I:I))/=IACHAR('.')) THEN
      WRITE(LU_ERR,'(/A,I2,A,A)') 'ERROR: Invalid character in atom multiplier at position ',I,' in FORUMLA for ',TRIM(FORMULA)
      STOP
   ELSE
      K=I
   ENDIF
ENDDO

IF (NUM < 0._EB) READ(FORMULA(J:K),*) NUM

J=I

END SUBROUTINE GET_ATOM_MULTIPLIER


SUBROUTINE PARSE_EQUATION(NR)
USE TYPES, ONLY: REACTION_TYPE,REACTION,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
USE GLOBAL_CONSTANTS, ONLY: N_TRACKED_SPECIES
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
INTEGER, INTENT(IN) :: NR
CHARACTER(MESSAGE_LENGTH) :: MESSAGE
CHARACTER(FORMULA_LENGTH) :: FORMULA
INTEGER :: I,J,K,LEN1,SPEC_PTR,NS
LOGICAL :: LHS,NAME_FOUND
TYPE(REACTION_TYPE),POINTER::RN=>null()

RN => REACTION(NR)

CALL CHECK_REACTION_CHARACTERS(RN%EQUATION)

LHS=.TRUE.
LEN1 = LEN(TRIM(RN%EQUATION))
I=1
SPEC_PTR=0
DO WHILE (I <= LEN1)
   CALL GET_NU(RN%EQUATION,I,LEN1,RN%NU_READ(SPEC_PTR+1))
   IF (LHS) RN%NU_READ(SPEC_PTR+1) = -RN%NU_READ(SPEC_PTR+1)
   DO J=I,LEN1
      IF(IACHAR(RN%EQUATION(J:J))==IACHAR('+') .OR. IACHAR(RN%EQUATION(J:J))==IACHAR('=')) THEN
         IF(IACHAR(RN%EQUATION(J:J))==IACHAR('=')) LHS=.FALSE.
         K = J - 1
         EXIT
      ENDIF
      K=J
   ENDDO
   FORMULA=''
   WRITE(FORMULA(1:K-I+1),'(A)') RN%EQUATION(I:K)
   NAME_FOUND = .FALSE.
   DO NS=1,N_TRACKED_SPECIES
      IF(TRIM(SPECIES_MIXTURE(NS)%ID)==TRIM(FORMULA) .OR. TRIM(SPECIES_MIXTURE(NS)%FORMULA)==TRIM(FORMULA)) THEN
         NAME_FOUND=.TRUE.
         RN%SPEC_ID_NU_READ(SPEC_PTR+1) = SPECIES_MIXTURE(NS)%ID
      ENDIF
   ENDDO
   IF (.NOT. NAME_FOUND) THEN
      WRITE(MESSAGE,'(A,I0,A,I0,A)') 'ERROR: Problem with REAC ',NR,'. Species number ',SPEC_PTR+1,&
                                    ' in the EQUATION was not found.'
      CALL SHUTDOWN(MESSAGE) ; RETURN
   ENDIF
   SPEC_PTR = SPEC_PTR + 1
   I = K+2
END DO

END SUBROUTINE PARSE_EQUATION


SUBROUTINE GET_NU(EXPRESSION,J,LEN1,NU)
USE GLOBAL_CONSTANTS, ONLY:LU_ERR
CHARACTER(255), INTENT(IN)::EXPRESSION
INTEGER,INTENT(IN):: LEN1
INTEGER,INTENT(INOUT)::J
INTEGER::I,K
REAL(EB),INTENT(OUT)::NU

NU=-1._EB
IF (J>LEN1) THEN
   NU=1._EB
   RETURN
ENDIF
DO I=J,LEN1
   IF(IACHAR(EXPRESSION(I:I))==IACHAR('*')) THEN
      IF(I==J) THEN
         WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)
         WRITE(LU_ERR,'(A,I0)') 'ERROR: No number before * at position ',I
         STOP
      ELSE
         K=I-1
         EXIT
      ENDIF
   ELSEIF((IACHAR(EXPRESSION(I:I))<IACHAR('0') .OR. IACHAR(EXPRESSION(I:I))>IACHAR('9')).AND.&
           IACHAR(EXPRESSION(I:I))/=IACHAR('.')) THEN
      IF(I==J) THEN
         NU=1._EB
         K=J-1
         EXIT
      ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR(',') .OR. IACHAR(EXPRESSION(I:I))==IACHAR('-')) THEN
         NU=1._EB
         K=J-1
         EXIT
      ELSE
         WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)
         WRITE(LU_ERR,'(A,I0)') 'ERROR: Invalid character in nu at position ',I
         STOP
      ENDIF
   ENDIF
ENDDO

IF (NU < 0._EB) READ(EXPRESSION(J:K),*) NU
J=K+1
IF (IACHAR(EXPRESSION(J:J))==IACHAR('*')) J=J+1

END SUBROUTINE GET_NU


SUBROUTINE CHECK_REACTION_CHARACTERS(EXPRESSION)
USE GLOBAL_CONSTANTS, ONLY:LU_ERR
CHARACTER(255),INTENT(IN)::EXPRESSION
INTEGER :: I,LEN1

LEN1=LEN(TRIM(EXPRESSION))

DO I=1,LEN1
  IF(IACHAR(EXPRESSION(I:I))>=IACHAR('A') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('Z')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))>=IACHAR('a') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('z')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))>=IACHAR('0') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('9')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR('+').OR.IACHAR(EXPRESSION(I:I))==IACHAR('=').OR.IACHAR(EXPRESSION(I:I))==IACHAR('.')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR('(').OR.IACHAR(EXPRESSION(I:I))==IACHAR(')').OR.IACHAR(EXPRESSION(I:I))==IACHAR('*')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR(' ').OR.IACHAR(EXPRESSION(I:I))==IACHAR(',').OR.IACHAR(EXPRESSION(I:I))==IACHAR('-')) THEN
     CYCLE
  ELSE
     WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)
     WRITE(LU_ERR,'(A,I0)') 'ERROR: Invalid Character in REAC expression at position ',I
     STOP
  ENDIF
ENDDO

END SUBROUTINE CHECK_REACTION_CHARACTERS


SUBROUTINE SHUTDOWN_ATOM(ATOM_COUNT,NR,ERR)

! Stops the code gracefully after writing a message

USE GLOBAL_CONSTANTS, ONLY: LU_ERR,FN_OUTPUT,LU_OUTPUT,CHID,N_SPECIES,N_TRACKED_SPECIES
USE TYPES, ONLY:SPECIES,SPECIES_TYPE,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE,REACTION_TYPE,REACTION
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
INTEGER, INTENT(IN) :: NR
INTEGER :: I,NN,NS
REAL(EB), INTENT(IN) :: ATOM_COUNT(118),ERR
REAL(EB) :: REACTION_BALANCE(118)
LOGICAL :: EX
TYPE (REACTION_TYPE), POINTER :: RN=>NULL()

WRITE(LU_ERR,'(/A,I3,A)') 'ERROR: Problem with REAC ',NR,'. Unbalanced stoichiometry.'

! Write out the transformation matrix that converts species mixtures to primitive species

WRITE(LU_ERR,'(//A)') ' Gas Phase Reaction Information'

RN=>REACTION(NR)

IF (RN%ID/='null')  WRITE(LU_ERR,'(/3X,A,A)')   'Reaction ID:  ', TRIM(RN%ID)

WRITE(LU_ERR,'(/3X,A)')     'Stoichiometry'

WRITE(LU_ERR,'(/3X,A)')     'Primitive Species'
WRITE(LU_ERR,'(3X,A)')      'Species ID                                                 Stoich. Coeff.'
DO NN=1,N_SPECIES
   IF (ABS(RN%NU_SPECIES(NN))>=TWO_EPSILON_EB) WRITE(LU_ERR,'(3X,A,1X,F12.6)') SPECIES(NN)%ID,RN%NU_SPECIES(NN)
ENDDO

WRITE(LU_ERR,'(/3X,A)')     'Tracked (Lumped) Species'
WRITE(LU_ERR,'(3X,A)')      'Species ID                                                 Stoich. Coeff.'
DO NN=1,N_TRACKED_SPECIES
   IF (ABS(RN%NU(NN)) < TWO_EPSILON_EB) CYCLE
   IF (ABS(RN%NU(NN)) < 10000._EB) WRITE(LU_ERR,'(3X,A,1X,F12.6)') SPECIES_MIXTURE(NN)%ID,RN%NU(NN)
   IF (ABS(RN%NU(NN)) > 10000._EB) WRITE(LU_ERR,'(3X,A,1X,E12.5)') SPECIES_MIXTURE(NN)%ID,RN%NU(NN)
ENDDO

WRITE(LU_ERR,'(//A)') 'Atom Balance Details'

DO NS=1,N_TRACKED_SPECIES
   WRITE(LU_ERR,'(/3X,A,A)') 'Tracked (Lumped) Species:',SPECIES_MIXTURE(NS)%ID
   WRITE(LU_ERR,'(3X,A)') 'Element  nu*Atom Count'
   REACTION_BALANCE = RN%NU(NS)*SPECIES_MIXTURE(NS)%ATOMS
   DO I=1,118
      IF (ABS(REACTION_BALANCE(I))>TWO_EPSILON_EB) THEN
         WRITE(LU_ERR,'(3X,A,3X,F12.6)') ELEMENT(I)%ABBREVIATION,REACTION_BALANCE(I)
      ENDIF
   ENDDO
ENDDO


WRITE(LU_ERR,'(//A)') 'The following elements are unbalanced:'
WRITE(LU_ERR,'(/A)') 'Element  Atom Error'

DO I=1,118
   IF (ABS(ATOM_COUNT(I)) > ERR) WRITE(LU_ERR,'(2X,A,4X,E10.3)') ELEMENT(I)%ABBREVIATION,ATOM_COUNT(I)
ENDDO

! For those running FDS on a PC, ensure that error message gets written to the .out file, too.

INQUIRE(FILE=FN_OUTPUT,EXIST=EX)
IF (.NOT.EX) OPEN(LU_OUTPUT,FILE=TRIM(CHID)//'.out',STATUS='REPLACE',FORM='FORMATTED')

WRITE(LU_OUTPUT,'(/A,I3,A)') 'ERROR: Problem with REAC ',NR,'. Unbalanced stoichiometry.'

! Write out the transformation matrix that converts species mixtures to primitive species

WRITE(LU_OUTPUT,'(//A)') ' Gas Phase Reaction Information'

RN=>REACTION(NR)

IF (RN%ID/='null')  WRITE(LU_OUTPUT,'(/3X,A,A)')   'Reaction ID:  ', TRIM(RN%ID)

WRITE(LU_OUTPUT,'(/3X,A)')     'Stoichiometry'

WRITE(LU_OUTPUT,'(/3X,A)')     'Primitive Species'
WRITE(LU_OUTPUT,'(3X,A)')      'Species ID                                                 Stoich. Coeff.'
DO NN=1,N_SPECIES
   IF (ABS(RN%NU_SPECIES(NN))>=TWO_EPSILON_EB) WRITE(LU_OUTPUT,'(3X,A,1X,F12.6)') SPECIES(NN)%ID,RN%NU_SPECIES(NN)
ENDDO

WRITE(LU_OUTPUT,'(/3X,A)')     'Tracked (Lumped) Species'
WRITE(LU_OUTPUT,'(3X,A)')      'Species ID                                                 Stoich. Coeff.'
DO NN=1,N_TRACKED_SPECIES
   IF (ABS(RN%NU(NN)) < TWO_EPSILON_EB) CYCLE
   IF (ABS(RN%NU(NN)) < 10000._EB) WRITE(LU_OUTPUT,'(3X,A,1X,F12.6)') SPECIES_MIXTURE(NN)%ID,RN%NU(NN)
   IF (ABS(RN%NU(NN)) > 10000._EB) WRITE(LU_OUTPUT,'(3X,A,1X,E12.5)') SPECIES_MIXTURE(NN)%ID,RN%NU(NN)
ENDDO

WRITE(LU_OUTPUT,'(//A)') 'Atom Balance Details'

DO NS=1,N_TRACKED_SPECIES
   WRITE(LU_OUTPUT,'(/3X,A,A)') 'Tracked (Lumped) Species:',SPECIES_MIXTURE(NS)%ID
   WRITE(LU_OUTPUT,'(3X,A)') 'Element  nu*Atom Count'
   REACTION_BALANCE = RN%NU(NS)*SPECIES_MIXTURE(NS)%ATOMS
   DO I=1,118
      IF (ABS(REACTION_BALANCE(I))>TWO_EPSILON_EB) THEN
         WRITE(LU_OUTPUT,'(3X,A,3X,F12.6)') ELEMENT(I)%ABBREVIATION,REACTION_BALANCE(I)
      ENDIF
   ENDDO
ENDDO


WRITE(LU_OUTPUT,'(//A)') 'The following elements are unbalanced:'
WRITE(LU_OUTPUT,'(/A)') 'Element  Atom Error'

DO I=1,118
   IF (ABS(ATOM_COUNT(I)) > ERR) WRITE(LU_OUTPUT,'(2X,A,4X,E10.3)') ELEMENT(I)%ABBREVIATION,ATOM_COUNT(I)
ENDDO

CALL SHUTDOWN('')

END SUBROUTINE SHUTDOWN_ATOM


END MODULE PROPERTY_DATA
